gtensor
gtensor copied to clipboard
CUDA host/device warnings (shape ctor not device)
Building codes that use gt::adapt_device can result in a lot of spurious warnings:
include/gtensor/gtensor_span.h(263): warning #20011-D: calling a __host__ function("gt::sarray<int, (unsigned long)5ul> ::sarray(const int *, unsigned long)") from a __host__ __device__ function("gt::adapt_device<(unsigned long)5ul, const double> ") is not allowed
It's not clear how to make the sarray ctor device, the simplest change would be to make adapt_device host only, but I think PSC may be using it. @germasch what do you think?
I think this was fixed in 54251ecdd591e6f3204a0b86d52c0944c7502958, and re-introduced in 5ef9f0b5de4adeca648b86e92813c52bd80865fa
Note that it's the version that takes an int array that is unsafe for device. The shape version is fine. The think the right solution is to re-apply fix from 54251ec, making only the shape version GT_INLINE.