Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMATH_HOSTDEVICE for hsv2rgb() ? #370

Open
AlexeySmolenchuk opened this issue Feb 14, 2024 · 3 comments
Open

IMATH_HOSTDEVICE for hsv2rgb() ? #370

AlexeySmolenchuk opened this issue Feb 14, 2024 · 3 comments
Assignees

Comments

@AlexeySmolenchuk
Copy link

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

@oxt3479
Copy link
Contributor

oxt3479 commented Feb 14, 2024

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.

@oxt3479 oxt3479 self-assigned this Feb 14, 2024
@AlexeySmolenchuk
Copy link
Author

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.

@meshula
Copy link
Contributor

meshula commented Feb 15, 2024

ImathMatrixAlgo.cpp only really needs to have the explicit instantiations (

template IMATH_EXPORT void jacobiEigenSolver (
) defined in it; it could be moved to a header which might resolve the header only goal. I think it's in fact the case that we don't need the instantiations any more, either. They were originally implemented like that to solve for limitations of VS2005, which have long since been resolved, to my knowledge.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants