Skip to content

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

Open
@jkant

Description

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!

Metadata

Assignees

No one assigned

    Labels

    question ❓Further information is requesteduntriaged 🧰A new issue that needs initial triage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions