includes for surf2Dwrite() ???

Hey guys,

Once again sorry for the relatively simple question - I’m still learning the API :)

Could someone please tell me why I cannot make calls to surf2Dwrite() in my kernals, VS is saying the identifier is undefined.

I have included surface_functions.h which I thought would be all I need? Is there something else?

I am using a GTX 770 which is compute capability 3.5, which is apparently enough (2.0 is minimum I think?)

Any help would be greatly appreciated!!!

A small update, in that header file is the line

#if defined(__cplusplus) && defined(__CUDACC__)

I think the CUDACC is the issue…

I guess you’re getting tripped up by Intellisense. If your project is a proper VS CUDA project and you are compiling with nvcc, you don’t need to include any header files. If you’re judging that “VS is saying the identifier is undefined” based on the intellisense red underline, that is an artifact of intellisense and not necessarily the case if you actually compile the code.

…oh dear god I hope you are kidding! I didn’t even think of that (have experienced with some other cuda functions).
I shall go ahead and finish the app and run it.

Thank you for your help once again!!!

You can remove VS complaints and write your own header with:

template<class T>
void surf2Dwrite(T data, cudaSurfaceObject_t surfObj, int x, int y,
                 cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap);