Skip to content
Snippets Groups Projects
Commit 89a6c556 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Call pybind11::array by value

parent bdd0e1e6
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ class PybindArrayDestructuring(DestructuringBindingsForFieldClass):
}
CLASS_NAME_TEMPLATE = "pybind11::array_t<{dtype}>"
ARGS_AS_REFERENCE = False
headers = ["<pybind11/numpy.h>"]
......
......@@ -187,7 +187,7 @@ cudaMalloc{ndim}Array(&{array}, &channel_desc_{texture_name}, """ + (
copy_params = f'cpy_{texture_name}_params'
return f"""cudaMemcpy3DParms {copy_params}{{}};
{copy_params}.srcPtr = {{{self._device_ptr},
{self._texture.field.strides[-1] * self._texture.field.shape[-1] * self._dtype.numpy_dtype.itemsize},
{self._texture.field.strides[-1] * self._texture.field.shape[-2]},
{self._texture.field.shape[-1]},
{self._texture.field.shape[-2]}}};
{copy_params}.dstArray = {array};
......@@ -201,7 +201,7 @@ cudaMemcpy3D(&{copy_params});""" # noqa
0u,
0u,
{self._device_ptr},
{self._texture.field.strides[-1] * self._texture.field.shape[-1] * self._dtype.numpy_dtype.itemsize},
{self._texture.field.strides[-1]},
{self._texture.field.shape[-1]},
{self._texture.field.shape[-2]},
cudaMemcpyDeviceToDevice);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment