We would like to do the following using the driver API:
On the Host:
- Create an Array (2D array of 32bit words)
- Attach a texture reference to the array to allow cached access to the array
- Get the pointer to the array through the texture reference using cuTexRefGetAddress
- pass the kernel the pointer to the device memory as well as the texture reference
- Launch the kernel
On the Kernel:
- read from texture memory
- perform an operation
- write back to the address where the texture references the device memory
We’ve noticed that we can get the valid address from a texture reference if we used cuTexRefSetAddress to attach the texture, and we can get a valid array back when using SetArray to attach, but we cannot get a pointer to the memory allocated by the array when attaching an array.
The question is, what is the best way to go about getting the device address of an array that is attached to a texture?
Also, is there any example of using cuTexRefGetAddress or cuTexRefSetAddress? What is *pdptr - there does not seem to be any documentation on that parameter.