Ahmed Fasih <wuzzyview(a)gmail.com> writes:
Hiya, I'm trying to use a texture in the wrap
addressing mode (i.e.,
search the CUDA programming guide for 'cudaAddressModeWrap'), which
needs normalized coordinates, and I am getting a signature error.
The relevant bit of the kernel:
texture<float2, 2, cudaReadModeElementType> tex_rp;
The relevant bits in Python:
import pycuda.driver as cuda
# ...
bind_array_to_texref(arr, rptex)
rptex.set_flags(cuda.TRSF_NORMALIZED_COORDINATES)
rptex.set_filter_mode(cuda.filter_mode.LINEAR)
rptex.set_address_mode(cuda.address_mode.WRAP) # [*]
I want normalized coordinates, I want to take advantage of linear
interpolation, and I want to index into the array outside of [0,
1-1/N] with wrap mode. The error happens with my last desideratum, at
line [*] above:
ArgumentError: Python argument types in
TextureReference.set_address_mode(TextureReference, address_mode)
did not match C++ signature:
set_address_mode(pycuda::texture_reference {lvalue}, int dim,
CUaddress_mode_enum am)
Looks like that should be
rptex.set_address_mode(0, cuda.address_mode.WRAP) # (for 'int dim')
http://documen.tician.de/pycuda/driver.html#pycuda.driver.TextureReference.…
Andreas