Closed corbett5 closed 1 year ago
If we really wanted to we could put error messages up higher in the call stack so that say the Array copy constructor would say something like "can't copy construct an Array< ..., ChaiBuffer> on device". But that seems a bit excessive to me.
I updated the error message you see when you capture an Array
on device.
Now part of https://github.com/GEOS-DEV/LvArray/pull/288
Say you try and capture an Array by value in a device lambda, I think we've all made this mistake before
Previous error message was the result of calling a host function on device
Now you get something clearer, although albeit much longer
The only downside I see is that I have to mark certain function in
ChaiBuffer
which should really be host only as host-device. But I don't really see this as a problem since clearly the compiler was fine calling these host functions from device.