cudaAddressModeBorder

Does anyone have any info on the last enumerator in the following enum?

enum cudaTextureAddressMode

CUDA texture address modes

Enumerator:
cudaAddressModeWrap Wrapping address mode
cudaAddressModeClamp Clamp to edge address mode
cudaAddressModeMirror Mirror address mode
cudaAddressModeBorder Border address mode

I’m looking for a clamp-to-predefined-value option for textures i CUDA and was hoping that this was it, but I can’t find any info.

Is border address mode only supported for normalized texture coords, like the wrapping address mode?

Does anyone have any info on the last enumerator in the following enum?

enum cudaTextureAddressMode

CUDA texture address modes

Enumerator:
cudaAddressModeWrap Wrapping address mode
cudaAddressModeClamp Clamp to edge address mode
cudaAddressModeMirror Mirror address mode
cudaAddressModeBorder Border address mode

I’m looking for a clamp-to-predefined-value option for textures i CUDA and was hoping that this was it, but I can’t find any info.

Is border address mode only supported for normalized texture coords, like the wrapping address mode?

Jon, you are right - cudaAddressModeBorder doesn’t seem to have corresponding function to set user-defined border values (according to CUDA 3.2 reference manual). It is quite interesting because I thought that the functionality will be similar to OpenGL.

Let’s hope NVIDIA guys will help us understand how to set user defined border value.

Nobody knows?

Yes,the cudaAddressModeBorder address mode clamps to the border color, like in OpenGL:
http://www.opengl.org/registry/specs/ARB/texture_border_clamp.txt

It only works with normalized coordinates, like the repeat modes.

Unfortunately the border color is fixed to black (zero) currently. We have an RFE open to add an API function to set the border color. Post here if you would like this.

meanwhile cudaAddressModeBorder seems to work with normalized and with non-normalized coordinates (cuda 4.0)

Yes, we’d make use of the ability to use an API call to set the border color used with cudaAddressModeBorder. Black is useful but restrictive, and it would help in some of our mosaic techniques to be able to use another border clamp value (any arbitrary value within range for the texture type).