aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorJon Chesterfield <jonathanchesterfield@gmail.com>2023-07-20 13:43:17 +0100
committerJon Chesterfield <jonathanchesterfield@gmail.com>2023-07-20 13:43:17 +0100
commitd483824fc8edc3463970beeb7b6c9cb3991bd510 (patch)
tree597e5e5e2376734e4dbd81396013478a16380881 /libc
parent8b5d3ba829c162fd4890fd65a4629ce0715825ee (diff)
downloadllvm-d483824fc8edc3463970beeb7b6c9cb3991bd510.zip
llvm-d483824fc8edc3463970beeb7b6c9cb3991bd510.tar.gz
llvm-d483824fc8edc3463970beeb7b6c9cb3991bd510.tar.bz2
[libc][amdgpu] Tolerate different install directories for hsa.h
HSA headers might be under a hsa/ directory or might not. This scheme matches the one used by the openmp amdgpu plugin. Reviewed By: jhuber6, jplehr Differential Revision: https://reviews.llvm.org/D155812
Diffstat (limited to 'libc')
-rw-r--r--libc/utils/gpu/loader/amdgpu/Loader.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libc/utils/gpu/loader/amdgpu/Loader.cpp b/libc/utils/gpu/loader/amdgpu/Loader.cpp
index b49d576..c80c4e6 100644
--- a/libc/utils/gpu/loader/amdgpu/Loader.cpp
+++ b/libc/utils/gpu/loader/amdgpu/Loader.cpp
@@ -15,8 +15,18 @@
#include "Loader.h"
-#include <hsa/hsa.h>
-#include <hsa/hsa_ext_amd.h>
+#if defined(__has_include)
+#if __has_include("hsa/hsa.h")
+#include "hsa/hsa.h"
+#include "hsa/hsa_ext_amd.h"
+#elif __has_include("hsa.h")
+#include "hsa.h"
+#include "hsa_ext_amd.h"
+#endif
+#else
+#include "hsa/hsa.h"
+#include "hsa/hsa_ext_amd.h"
+#endif
#include <cstdio>
#include <cstdlib>