#include <cutil.h>
device host inline int ID2BiID__( unsigned __int64 id) // strange: if this is assigned to a float, compiler dies
{
int p = int(id >> (59-3)) ;
return p ;
}
global void test(float *f, const unsigned int64 *node_ids)
{
*f = ID2BiID( node_ids[0] ) ;
}
void main()
{
float *a ;
unsigned __int64 *b ;
test<<<1, 1>>>( a, b ) ;
}
compile the above program will result in a compiler error:
1>### Assertion failure at line 1440 of …/…/be/cg/cgemit.cxx:
1>### Compiler Error in file C:\DOCUME~1\aaa\LOCALS~1\Temp/tmpxft_00000844_00000000-4.i during Assembly phase:
1>### incorrect register class for operand 0
1>nvopencc ERROR: C:\CUDA\bin/…/open64/lib//be.exe returned non-zero status 1
I have to use an int64 as an id here, any ideas how I could workaround this?