Hey there... so I am here using VS2008, programming with CUDA C. I have the 3.2 toolkit installed and working.
Now my problem is, i have a file with this:
#ifndef _cuda_rng_cu_included_
#define _cuda_rng_cu_included_
#include <stdio.h>
static void HandleError( cudaError_t err,
const char *file,
int line ) {
if (err != cudaSuccess) {
printf( "%s in %s at line %d\n", cudaGetErrorString( err ),
file, line );
exit( EXIT_FAILURE );
}
}
#define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ ))
//some other struct
I got this code from the book CUDA by example, so it should work.. but when i hit build i get this error (the first):
error C2065: 'cudaError_t' : undeclared identifier
and then a tsunami of errors are appended, like uint2
type not being found and variables not being declared.
What could be the problem? cudaError_t is defined in $(CUDA_PATH_V3_2)\include and this path is in my required include directory.
The file property is set like to: Tool: CUDA Runtime API
I put that #ifndef because i haven't figured out how to work with the linker between normal C++ and CUDA C. Like if i have a struct with both CUDA C (__global__
and ` __device__
) and some normal methods. If i name this file .cu
then in the normal C++ code that uses this struct an error is printed saying it wasn't declared.
I tried to manually include driver_types.h
and tons of other headers, but none of them are found by the compiler.
Sorry if i wasn't clear, i'm sleepy.