https://github.com/illwieckz created https://github.com/llvm/llvm-project/pull/95484
The `dynamic_hsa/` include directory is required by both optional `dynamic_hsa/hsa.cpp` and non-optional `src/rtl.cpp`. It should then always be included or the build will fail if only `src/rtl.cpp` is built. This also simplifies the way header files from `dynamic_hsa/` are included in `src/rtl.cpp`. Fixes: ``` error: ‘HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY’ was not declared in this scope ``` >From e84e8bdef6d902d51a72eb93f7ca9812f0467c72 Mon Sep 17 00:00:00 2001 From: Thomas Debesse <d...@illwieckz.net> Date: Fri, 14 Jun 2024 00:38:25 +0200 Subject: [PATCH] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dynamic_hsa/ include directory is required by both optional dynamic_hsa/hsa.cpp and non-optional src/rtl.cpp. It should then always be included or the build will fail if only src/rtl.cpp is built. This also simplifies the way header files from dynamic_hsa/ are included in src/rtl.cpp. Fixes: error: ‘HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY’ was not declared in this scope --- .../libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt | 4 +++- openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp | 10 ---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt b/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt index 68ce63467a6c8..42cc560c79112 100644 --- a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt +++ b/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt @@ -38,13 +38,15 @@ add_definitions(-DDEBUG_PREFIX="TARGET AMDGPU RTL") set(LIBOMPTARGET_DLOPEN_LIBHSA OFF) option(LIBOMPTARGET_FORCE_DLOPEN_LIBHSA "Build with dlopened libhsa" ${LIBOMPTARGET_DLOPEN_LIBHSA}) +# Required by both optional dynamic_hsa/hsa.cpp and non-optional src/rtl.cpp. +include_directories(dynamic_hsa) + if (${hsa-runtime64_FOUND} AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBHSA) libomptarget_say("Building AMDGPU NextGen plugin linked against libhsa") set(LIBOMPTARGET_EXTRA_SOURCE) set(LIBOMPTARGET_DEP_LIBRARIES hsa-runtime64::hsa-runtime64) else() libomptarget_say("Building AMDGPU NextGen plugin for dlopened libhsa") - include_directories(dynamic_hsa) set(LIBOMPTARGET_EXTRA_SOURCE dynamic_hsa/hsa.cpp) set(LIBOMPTARGET_DEP_LIBRARIES) endif() diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp index 81634ae1edc49..8cedc72d5f63c 100644 --- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp +++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp @@ -56,18 +56,8 @@ #define BIGENDIAN_CPU #endif -#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 namespace llvm { namespace omp { _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits