के बीच अंतर करते हैं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