diff --git a/source/pysph/base/particle_array.pyx b/source/pysph/base/particle_array.pyx index a2d571e..7faa02a 100644 --- a/source/pysph/base/particle_array.pyx +++ b/source/pysph/base/particle_array.pyx @@ -1255,8 +1255,7 @@ cdef class ParticleArray: if dtype == "long": array = array.astype(numpy.int32) - cl.enqueue_read_buffer(self.queue, buffer, array).wait() - #cl.enqueue_copy_buffer(self.queue, buffer, array).wait() + cl.enqueue_copy(self.queue, src=buffer, dest=array).wait() self.set( **{prop:array} ) diff --git a/source/pysph/solver/cl_integrator.py b/source/pysph/solver/cl_integrator.py index 15ad17b..c1ecebb 100644 --- a/source/pysph/solver/cl_integrator.py +++ b/source/pysph/solver/cl_integrator.py @@ -76,8 +76,9 @@ def set_initial_buffers(self): update_prop_buffer = pa.get_cl_buffer(update_prop) initial_prop_buffer = pa.get_cl_buffer(initial_prop) - cl.enqueue_copy_buffer(queue=queue, src=update_prop_buffer, - dst=initial_prop_buffer).wait() + cl.enqueue_copy(queue=queue, src=update_prop_buffer, + dest=initial_prop_buffer, + ).wait() pa.read_from_buffer() @@ -106,8 +107,8 @@ def reset_current_buffers(self, calcs): # reset the current property to the initial array - cl.enqueue_copy_buffer(queue=queue,src=initial_prop_buffer, - dst=update_prop_buffer) + cl.enqueue_copy(queue=queue,src=initial_prop_buffer, + dest=update_prop_buffer) def eval(self, calcs): @@ -146,7 +147,7 @@ def eval(self, calcs): update_prop_buffer = pa.get_cl_buffer(update_prop) cl.enqueue_copy_buffer(queue, src=step_prop_buffer, - dst=update_prop_buffer).wait() + dest=update_prop_buffer).wait() # ensure that all processes have reached this point @@ -169,8 +170,9 @@ def eval(self, calcs): k_prop_buffer = pa.get_cl_buffer(k_prop) - cl.enqueue_copy_buffer(queue, src=step_prop_buffer, - dst=k_prop_buffer).wait() + cl.enqueue_copy(queue, src=step_prop_buffer, + dest=k_prop_buffer, + ).wait() pass @@ -212,8 +214,8 @@ def step(self, calcs, dt): current_buffer, step_buffer, tmp_buffer, cl_dt) - cl.enqueue_copy_buffer(queue, src=tmp_buffer, - dst=current_buffer) + cl.enqueue_copy(queue, src=tmp_buffer, + dest=current_buffer) pass pass @@ -260,11 +262,13 @@ def final_step(self, calc, dt): initial_buffer, k1_buffer, tmp_buffer, cl_dt).wait() - cl.enqueue_copy_buffer(queue, src=tmp_buffer, - dst=initial_buffer).wait() + cl.enqueue_copy(queue, src=tmp_buffer, + dest=initial_buffer, + ).wait() - cl.enqueue_copy_buffer(queue, src=tmp_buffer, - dst=update_buffer).wait() + cl.enqueue_copy(queue, src=tmp_buffer, + dest=update_buffer, + ).wait() def integrate(self, dt): diff --git a/source/pysph/solver/tests/test_cl_common.py b/source/pysph/solver/tests/test_cl_common.py index fd1504c..c29b8db 100644 --- a/source/pysph/solver/tests/test_cl_common.py +++ b/source/pysph/solver/tests/test_cl_common.py @@ -29,7 +29,8 @@ args = (ybuf, zbuf) pysph_root = solver.get_pysph_root() -src = open(path.join(pysph_root, 'solver/cl_common.cl')).read() +src = solver.cl_read(path.join(pysph_root, 'solver/cl_common.cl'), + precision='single') prog = cl.Program(ctx, src).build(options=solver.get_cl_include()) @@ -37,9 +38,9 @@ prog.set_tmp_to_zero(q, (16, 16, 16), (1,1,1), xbuf, *args) # read the buffer contents back to the arrays -cl.enqueue_read_buffer(q, xbuf, x).wait() -cl.enqueue_read_buffer(q, ybuf, y).wait() -cl.enqueue_read_buffer(q, zbuf, z).wait() +cl.enqueue_copy(q, src=xbuf, dest=x).wait() +cl.enqueue_copy(q, src=ybuf, dest=y).wait() +cl.enqueue_copy(q, src=zbuf, dest=z).wait() for i in range(np): assert x[i] == 0.0