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