if(TARGET amdgpu-arch) doesn't work when ENABLE_LLVM_PROJECTS=openmp because openmp subdirectory is processed before clang subdirectory. Adopt the same logic of enabling tests like the CUDA plugin.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This replaces "enable tests when there's a GPU" with "enable tests when HSA is on the system". That would make it match nvptx. Did you consider the other way round, only run nvptx tests when a GPU is present, as opposed to when CUDA is installed?
The logic is changed to enable tests when HSA is on the system. Enable tests is not equal to run tests.
Did you consider the other way round, only run nvptx tests when a GPU is present, as opposed to when CUDA is installed?
Enabling tests should not depend on whether there is a GPU or not. My use case is, I build llvm on a node with many CPU cores. Then grab an AMD GPU node to run amdgpu tests and a NVDIA PGU node to run nvptx tests. All the nodes share a file system.
The old cmake has another broken logic. It will build amdgpu-arch since it is a CMake target but it tries to run amdgpu-arch via execute_process at CMake stage before it gets built. I'm pretty sure something in the environment gets pulled in instead of the one to be built.
Use case is compelling for me. Build on one node and run on others is standard HPC fare. People who have HSA installed and no GPU and build llvm from source can disable their plugin with the existing cmake flag.