 		}
 	}
 	
-	func setArg(position: cl_uint, buffer: Buffer) -> cl_int {
+	func setArg<T>(position: cl_uint, buffer: Buffer<T>) -> cl_int {
 		return clSetKernelArg(kernel, position, sizeof(cl_mem), &(buffer.buffer))
 	}
 	

	}
}

class Buffer {
	var buffer: cl_mem
	var size: Int
	init(context: Context, flags: cl_mem_flags, size: Int, data: UnsafeMutablePointer<Void>? = nil) {
		self.size = size
		buffer = clCreateBuffer(context.context, flags, size, data ?? nil, nil)
	}
	
	func enqueueRead(queue: CommandQueue) -> [cl_int] {
		var elements = Array<cl_int>(count: size / sizeof(cl_int), repeatedValue: cl_int(0))
		clEnqueueReadBuffer(queue.queue, buffer, cl_bool(CL_TRUE), 0, size, &elements, 0, nil, nil)
		return elements
	}
	
	deinit {

	b[i] = cl_int(i)
}

let aBuffer = Buffer(context: context, readOnlyData: a)
let bBuffer = Buffer(context: context, readOnlyData: b)
let cBuffer = Buffer<cl_int>(context: context, count: elements)

var status = kernel.setArg(0, buffer: aBuffer)
status |= kernel.setArg(1, buffer: bBuffer)
