I jave a C++ function GPU_init() which is ok if called from C main()
but CUDA dies horribly near first cudaMalloc if it is called from nested C function.
The two calls are identical
[codebox]C++ code
//Host-side interface
uch *d_window;
IPos *d_match;
int *d_len;
unsigned int hTimer; //CUDA timer
void GPU_init(const ulg window_size, const int max_chain_length) {
//use device with highest Gflops/s
cutilSafeCall(cudaSetDevice( cutGetMaxGflopsDeviceId() ));
//Allocate memory
cutilSafeCall( cudaMalloc((void **)&d_window, window_size * sizeof(uch)));
cutilSafeCall( cudaMalloc((void **)&d_match,max_chain_length * sizeof(IPos)));
cutilSafeCall( cudaMalloc((void **)&d_len, max_chain_length * sizeof(int)));
cutilCheckError(cutCreateTimer(&hTimer));
}
[/codebox]
Anyone seen anything similar?
Thanks
Bill
ps: does anyone else find these forums hard to navigate?