Throwing error "No Error"

Edit:

Found the answer. In my code, I had a semi-colon after the if-conditional, which made the following block execute regardless of the truth value.

I’m new.


I’m following the tutorial over at Dr. Dobbs that can be found here:

http://www.ddj.com/hpc-high-performance-computing/207603131

When it comes to this block, the “if” conditional is getting executed:

[codebox]void checkCUDAError(const char *msg)

{

cudaError_t err = cudaGetLastError();

if( cudaSuccess != err) 

{

    fprintf(stderr, "Cuda error: %s: %s.\n", msg, 

                              cudaGetErrorString( err) );

    exit(EXIT_FAILURE);

}                         

}[/codebox]

When I run the program, the output is:

“Cuda error: kernel invocation: no error.”

What kind of error is “no error”? Why is it not equal to cudaSuccess?