의 차이는Pyopencl : to_device 및 버퍼
import pyopencl as cl
import pyopencl.array as cl_array
import numpy
a = numpy.random.rand(50000).astype(numpy.float32)
mf = cl.mem_flags
a_gpu = cl.Buffer(self.ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=a)
및
a_gpu = cl_array.to_device(self.ctx, self.queue, a)
의 차이점은 무엇입니까하자?
그리고
result = numpy.empty_like(a)
cl.enqueue_copy(self.queue, result, result_gpu)
및
result = result_gpu.get()
의 차이점은 무엇입니까?
저는 방금 PyOpenCL의 저자임을 깨달았습니다. PyOpenCL과 답변에 감사드립니다. – petRUShka