Skip to content
Snippets Groups Projects
Commit 84279e64 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'cuda.TextureReference.set_array' into 'master'

cuda.TextureReference.set_array(tex_ref, cu_array) -> tex_ref.set_array(cu_array)

See merge request !134
parents d48ca2af 8568124d
No related branches found
No related tags found
1 merge request!134cuda.TextureReference.set_array(tex_ref, cu_array) -> tex_ref.set_array(cu_array)
Pipeline #22108 passed with warnings
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
""" """
from os.path import dirname, isdir, join from os.path import dirname, isdir, join
from typing import Union
import numpy as np import numpy as np
...@@ -29,7 +30,7 @@ def pow_two_divider(n): ...@@ -29,7 +30,7 @@ def pow_two_divider(n):
return divider return divider
def ndarray_to_tex(tex_ref, def ndarray_to_tex(tex_ref, # type: Union[cuda.TextureReference, cuda.SurfaceReference]
ndarray, ndarray,
address_mode=None, address_mode=None,
filter_mode=None, filter_mode=None,
...@@ -51,7 +52,7 @@ def ndarray_to_tex(tex_ref, ...@@ -51,7 +52,7 @@ def ndarray_to_tex(tex_ref,
raise TypeError( raise TypeError(
'ndarray must be numpy.ndarray or pycuda.gpuarray.GPUArray') 'ndarray must be numpy.ndarray or pycuda.gpuarray.GPUArray')
cuda.TextureReference.set_array(tex_ref, cu_array) tex_ref.set_array(cu_array)
tex_ref.set_address_mode(0, address_mode) tex_ref.set_address_mode(0, address_mode)
if ndarray.ndim >= 2: if ndarray.ndim >= 2:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment