[libc-commits] [PATCH] D155812: [libc][amdgpu] Tolerate different install directories for hsa.h
Jon Chesterfield via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Jul 20 03:19:41 PDT 2023
JonChesterfield created this revision.
JonChesterfield added a reviewer: jhuber6.
Herald added subscribers: libc-commits, kerbowa, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added projects: libc-project, All.
JonChesterfield requested review of this revision.
Herald added subscribers: jplehr, sstefan1, wdng.
Herald added a reviewer: jdoerfert.
HSA headers might be under a hsa/ directory or might not.
This scheme matches the one used by the openmp amdgpu plugin.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155812
Files:
libc/utils/gpu/loader/amdgpu/Loader.cpp
Index: libc/utils/gpu/loader/amdgpu/Loader.cpp
===================================================================
--- libc/utils/gpu/loader/amdgpu/Loader.cpp
+++ 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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155812.542410.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230720/7f8aa816/attachment.bin>
More information about the libc-commits
mailing list