Add env var to override OCCA HIP compile arch#794
Add env var to override OCCA HIP compile arch#794dmcdougall wants to merge 1 commit intolibocca:developmentfrom
Conversation
|
@dmcdougall : Seems like both CUDA and HIP both set the architecture compiler option. Wondering |
|
@dmcdougall Could you update this to target the development branch? |
This commit teaches OCCA to understand the OCCA_HIP_OVERRIDE_COMPILE_ARCH environment variable. If set, OCCA will ignore the arch set in the kernel properties and try to compile for the architecture provided in the environment variable. This allows the user to have more control over what targets are JITted for. Usecases are for JITting for generic targets (see here: llvm/llvm-project@f93aa51) and for the (currently beta) amdgcnspirv target (see here: https://rocm.docs.amd.com/projects/llvm-project/en/latest/conceptual/spirv.html#rocm-support-for-spir-v-beta). Unfortunately, the amdgcnspirv target name doesn't start with "gfx", so I added a branch that checks for this case and treats it accordingly.
1b12aa8 to
e10068e
Compare
Rebased on top of |
Honestly, I think any backend should be able to do this.
I totally agree. I had initially wanted to do it this way, but didn't see a way for occa to consume the variable in a place that wasn't backend-specific.
Ah yes, maybe this is they way I should have done it to begin with. |
|
Before I continue with implementing @thilinarmtb's feedback, is the general principle behind this idea acceptable? |
I think this is a useful environment variable to have. Kris is on vacation so probably we will have to |
Description
This commit teaches OCCA to understand the
OCCA_HIP_OVERRIDE_COMPILE_ARCHenvironment variable. If set, OCCA will ignore the arch set in the kernel properties and try to compile for the architecture provided in the environment variable.This allows the user to have more control over what targets are JITted for. Usecases are for JITting for generic targets (see here) and for the (currently beta) amdgcnspirv target (see here).
Unfortunately, the amdgcnspirv target name doesn't start with "gfx", so I added a branch that checks for this case and treats it accordingly.
Comments, criticism, tomatoes, and hecklers are not only welcome but heavily encouraged.