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

Preprocessor define for when code is being compiled for compute? #894

Open
jkant opened this issue Jan 10, 2025 · 0 comments
Open

Preprocessor define for when code is being compiled for compute? #894

jkant opened this issue Jan 10, 2025 · 0 comments
Labels
question ❓ Further information is requested untriaged 🧰 A new issue that needs initial triage

Comments

@jkant
Copy link

jkant commented Jan 10, 2025

Is there a preprocessor define enabled for when the code is being compiled for compute vs. the normal CPU compiler?

I would like to be able to re-use as much code as I can, but the HLSL intrinsics don't do anything on the CPU side, whereas the System.Math equivalents won't work on the GPU. I would prefer to write a wrapper function around the couple of intrinsics I am using that conditionally points to the appropriate function, rather than maintain parallel versions of all the code that uses these intrinsics.

Thanks!

@jkant jkant added question ❓ Further information is requested untriaged 🧰 A new issue that needs initial triage labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question ❓ Further information is requested untriaged 🧰 A new issue that needs initial triage
Projects
None yet
Development

No branches or pull requests

1 participant