IMATH_HOSTDEVICE for hsv2rgb() ?
AlexeySmolenchuk opened this issue · comments
I've just tried to use Imath as a vector library for CUDA. I'm not sure if it's supposed to work like this, but I saw some promising comments in the source, so I've tried.
All hsv2rgb() in ImathColorAlgo.h are marked as IMATH_HOSTDEVICE but rely on hsv2rgb_d() which is a host-only function.
Please correct me if I'm wrong.
If it's some porting is currently ongoing, it would be very helpful to see which parts of the library are already supported by CUDA.
Thank you,
Alexey
That would be an oversight on my part. Right now I am determining why hsv2rgb_d() was not marked IMATH_HOSTDEVICE in the first place. Depending on what reason I discover I can either implement an alternative that can support CUDA or make sure hsv2rgb() is not marked IMATH_HOSTDEVICE.
why hsv2rgb_d() was not marked IMATH_HOSTDEVICE in the first place
Because it's implemented in separate cpp I guess.
Another candidate would be ImathMatrixAlgo.cpp
I see this old investigation task about the header-only version started #13 unfortunately without any outcome.
ImathMatrixAlgo.cpp only really needs to have the explicit instantiations (
Imath/src/Imath/ImathMatrixAlgo.cpp
Line 1241 in edb64a8
It would be harmless to move ColorAlgo to a header at this point as well.
#13's outcome was in fact that the majority of Imath did become header only; there's just a few outliers left to tackle.