CUDA assert bug?

Hello,

i’m trying to use C standard assert in a device function with device emulation enabled ( --deviceemu option ). This is my code:

#include <stdlib.h>

#include <stdio.h>    

#include <string.h>

#include <math.h>   

#include <assert.h>

__global__ void MyFunc ( RayOutput* roPtr )

{

	const unsigned int rIdx ( blockIdx.x*blockDim.x + threadIdx.x );

	#ifdef __DEVICE_EMULATION__ 

  assert ( rIdx<1024 ); 

	#endif

}

but it generates the following error:

error C2664: '_wassert' : cannot convert parameter 1 from 'const unsigned short [10]' to 'const wchar_t *'

I’m compiling with VS2005 SP1 under Windows Vista x64. The project is set to use unicode ()… but I also tried with MBCS and ASCII and got the same error.

Any idea how can I solve it without having to implement my own assert, pls?

Hi,

I recently updated to CUDA 2.3 and I’m seeing the same behaviour now. With CUDA 2.2 everything worked fine. Here is a code snipped:

[codebox]#include <assert.h>

device void test()

{

assert( 1 ); // error

}

int main()

{

assert( 1 ); // no error

return 0;

}[/codebox]

Compiling this in deviceemu mode produces the error

[codebox]error C2664: ‘_wassert’ : cannot convert parameter 1 from ‘const unsigned short [2]’ to ‘const wchar_t *’[/codebox]

I’m using Vista 32bit with Visual Studio 2008. Please help! My code ist full of assert statements, with are essential for debugging!!