Cuda Visual Studio Integration:

I have a CUDA project in Visual Studio 2019 that can’t seem to find the functions surf2Dread and surf2Dwrite or the built in vector types (uint4, int4,…etc.). I’ve linked to the libraries cuda.lib and cudart_static.lib. I’ve also pointed to the $(CudaToolkitIncludeDir) which has all the includes and included the following header files at the top of my header file. I’ve used the same code with less header files outside of visual studio and the code built and executed perfectly fine. I recently upgraded my CUDA toolkit to version 10.2. Has something changed since v9.1? Any help would be appreciated.

#include <stdint.h>
#include <cuda.h>
#include <types.cuh> //my personal header file
#include <texture.cuh> //my personal header file
#include <cuda_runtime.h>
#include <surface_functions.h> // added this thinking it would solve part of the issue
#include "device_launch_parameters.h" //needed this in VS but did not need this when compiling from command line

Error is

E0020: identifier "surf2Dread" is undefined

Also note that I have already tested my cuda environment in VS and can allocate gpu memory and run basic kernels but I cannot read/write to any surface objects.

If this is an intellisense error, you should probably just ignore it.

If it is an error that occurs when you build the project and results in a build failure, I suggest showing the full output from your build from the visual studio console window.

The error display window in VS2019 has a drop down box that you can use to show or hide intellisense errors. My recommendation would be to set this to “Build Only”

You were correct. There were quite a few error messages regarding these functions that took my attention away from the fact that my custom functions in this program were not being found either I did not initialize them in this project’s header file. Thank you!