surf2DWrite and float3, compilation error

Dear all,

I am currently trying to use surf2Write in a template kernel that follows the pattern:

template
global void writeKernel( cudaSurfaceObject_t surfobj)
{
//things using the T typename…
float3 data = make_float3(0.0f,0.0f,0.0f);
surf2DWrite(data, surfobj, x*sizeof(float3),y);
}

and I have the following problem when linking:
no instance of overloaded function surf2DWrite matches argument list …
With the argument list I provided: float3, cudaSurfaceObject_t, long, int …

I cannot reproduce the error when I simply replace float3 by uchar4, this example being given in the programming guide.
Previously I had a problem with surf3Dwrite and simple float, but, adding -gencode-arch=compute_30, code=sm_30 under cuda 5.5, solved it.

Now, I don’t undestand why I am still having a similar problem on float3, is this vector type even support by surf2Dread ???

I would really appreaciate any comment or indication on this problem, thank you in advance

1 Like

surf2DWrite<float1/2/4> but no 3

surfaces and textures only handle vector types of 1, 2, or 4 elements. We’ve covered this on a few of your questions.

1 Like

Haha, thank you for actually having my question answered 9 years and 11 month after I posted this. (I think I eventually got it figured out, and most likely thanks to help from Robert, who relentlessly supports developers like me for so many years).