Hello Community,
currently I am working on a project, where I have to set bits on a device array to track the code coverage of the cude code.
I have an array of a given size, which I need in device and on host.
On host, it works fine.
I declare in the normal cu files:
extern unsigned char hostArray;
and in another cu file I define it:
unsiged char hostArray[7];
The same thing I want to do is for the device.
I tried
extern device unsigned char deviceArray;
but then my system tells me: size not known.
if I declare
extern device unsigned char deviceArray[7];
it seems to let the cudaMemCpyFromSymbol fail, if I want to retrieve the data.
If I let it copy from the defining .cu-file, The array is just empty, so it seems it is only touched by the defining cuda.
I suspect both .cu-Files get their own device unsigned charArray;
TL;DR;
How can I use an array allocated on device across multiple .cu-files (just like a global c-array)?
Best regards,
Sebastian.