Trying to implement the followwing method
public static ulong ByteArrayToUlong(int n, byte array)
ulong k = 0;
for (i = 0; i < n; k += array[i++])
k <<= 8;
I realised that there is a problem on storing ulong numbers. It keeps only the 32 bits e.g. 0x32877FB0A17C40 it will convert it to 0xffffffffB0A17C40.
Does anyone else face something like it ??
Yes, the problem here is the bit shift on ulongs, which are being cast to ints by cudafy when generating the c code. It's a bug of the cudafy translator.
The easiest way around it is to write a DummyFunction in cudafy, which functions as a wrapper for the shl function. For info on dummy functions, check