Calling a CUDA function inside C++-Class

I get the following error:

cudaSafeCall() Runtime API error in file <raytracer.cu>, line 329 : unknown error.

I declared the functions as following:

raytracer.h

extern "C" float kernel_initialize(const int w, const int h);

raytracer.cu

float kernel_initialize(const int w, const int h)

{

	cutilSafeCall(cudaEventCreate(&start));  // LINE 329

	cutilSafeCall(cudaEventCreate(&stop));

}

The above functions will be call in the class RTKernel. The file raytracer.h is included in RTKernel.h.

The implementation looks like the following:

void RTKernel::initialize() const

{

	kernel_initialize(1280,720);

}

It drives me crazy. What’s going wrong here?