Skip to content

Commit

Permalink
[libc][amdgpu] Tolerate different install directories for hsa.h
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JonChesterfield committed Jul 20, 2023
1 parent 8b5d3ba commit d483824
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libc/utils/gpu/loader/amdgpu/Loader.cpp
Expand Up @@ -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>
Expand Down

0 comments on commit d483824

Please sign in to comment.