Open joek93 opened 1 year ago
I've implemented a runtime check, unfortunately I did not manage to implement a static one, as a code such as:
INLINE_FUNCTION constexpr CUDA_HOST_AND_DEVICE
void assertCorrectMemorySpace() const
{
#ifdef USE_CUDA
# ifdef COMPILING_FOR_DEVICE
static_assert(MT==MemoryType::CPU,""); /* always fail */
if constexpr(MT==MemoryType::CPU)
crash("Cannot evaluate on CPU");
# else
static_assert(MT==MemoryType::GPU,""); /* always fail */
if constexpr(MT==MemoryType::GPU)
crash("Cannot evaluate on GPU");
# endif
#endif
}
would always fail
then the machinery to move from host do device must still be implemented, please tell me if the error is correctly cought
A segmentation violation error appears at runtime when one tries to read Field2 components from HOST (with
master_printf
, for example), when Field2 is allocated on DEVICE (--with-threads-type=cuda
).