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)

This texture works fine if I guarantee indexes within [0, 1-1/N] and
leave out the call to set_address_mode(). Apologies if I'm
(unsurprisingly) doing something absurdly stupid. Thanks,
Ahmed

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to