From: Jon Chesterfield Date: Thu, 20 Jul 2023 12:43:17 +0000 (+0100) Subject: [libc][amdgpu] Tolerate different install directories for hsa.h X-Git-Tag: upstream/17.0.6~989 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d483824fc8edc3463970beeb7b6c9cb3991bd510;p=platform%2Fupstream%2Fllvm.git [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 --- 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 -#include +#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 #include