diff --git a/openmp/libomptarget/plugins/amdgpu/impl/atmi.cpp b/openmp/libomptarget/plugins/amdgpu/impl/atmi.cpp --- a/openmp/libomptarget/plugins/amdgpu/impl/atmi.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/atmi.cpp @@ -4,10 +4,9 @@ * This file is distributed under the MIT License. See LICENSE.txt for details. *===------------------------------------------------------------------------*/ #include "atmi_runtime.h" +#include "hsa_api.h" #include "internal.h" #include "rt.h" -#include -#include #include /* diff --git a/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.h b/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.h --- a/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.h +++ b/openmp/libomptarget/plugins/amdgpu/impl/atmi_interop_hsa.h @@ -7,16 +7,14 @@ #define INCLUDE_ATMI_INTEROP_HSA_H_ #include "atmi_runtime.h" -#include "hsa.h" -#include "hsa_ext_amd.h" +#include "hsa_api.h" #include "internal.h" #include #include -#ifdef __cplusplus extern "C" { -#endif + /** \defgroup interop_hsa_functions ATMI-HSA Interop * @{ */ @@ -80,8 +78,6 @@ /** @} */ -#ifdef __cplusplus } -#endif #endif // INCLUDE_ATMI_INTEROP_HSA_H_ diff --git a/openmp/libomptarget/plugins/amdgpu/impl/atmi_runtime.h b/openmp/libomptarget/plugins/amdgpu/impl/atmi_runtime.h --- a/openmp/libomptarget/plugins/amdgpu/impl/atmi_runtime.h +++ b/openmp/libomptarget/plugins/amdgpu/impl/atmi_runtime.h @@ -7,16 +7,9 @@ #define INCLUDE_ATMI_RUNTIME_H_ #include "atmi.h" -#include "hsa.h" -#include -#include -#ifndef __cplusplus -#include -#endif +#include "hsa_api.h" -#ifdef __cplusplus extern "C" { -#endif /** \defgroup module_functions ATMI Module * @{ @@ -68,8 +61,6 @@ /** @} */ -#ifdef __cplusplus } -#endif #endif // INCLUDE_ATMI_RUNTIME_H_ diff --git a/openmp/libomptarget/plugins/amdgpu/impl/data.cpp b/openmp/libomptarget/plugins/amdgpu/impl/data.cpp --- a/openmp/libomptarget/plugins/amdgpu/impl/data.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/data.cpp @@ -4,15 +4,13 @@ * This file is distributed under the MIT License. See LICENSE.txt for details. *===------------------------------------------------------------------------*/ #include "atmi_runtime.h" +#include "hsa_api.h" #include "internal.h" #include "machine.h" #include "rt.h" #include -#include -#include #include #include -#include #include using core::TaskImpl; diff --git a/openmp/libomptarget/plugins/amdgpu/impl/hsa_api.h b/openmp/libomptarget/plugins/amdgpu/impl/hsa_api.h new file mode 100644 --- /dev/null +++ b/openmp/libomptarget/plugins/amdgpu/impl/hsa_api.h @@ -0,0 +1,14 @@ +//===------- hsa_api.h --------------------------------------- C++ --------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef AMDGPU_HSA_API_H_INCLUDED +#define AMDGPU_HSA_API_H_INCLUDED + +#include "hsa.h" +#include "hsa_ext_amd.h" + +#endif diff --git a/openmp/libomptarget/plugins/amdgpu/impl/internal.h b/openmp/libomptarget/plugins/amdgpu/impl/internal.h --- a/openmp/libomptarget/plugins/amdgpu/impl/internal.h +++ b/openmp/libomptarget/plugins/amdgpu/impl/internal.h @@ -12,18 +12,14 @@ #include #include -#include #include -#include #include #include #include #include #include -#include "hsa.h" -#include "hsa_ext_amd.h" -#include "hsa_ext_finalize.h" +#include "hsa_api.h" #include "atmi.h" #include "atmi_runtime.h" @@ -44,9 +40,7 @@ unsigned long kernarg_template_ptr; } atmi_implicit_args_t; -#ifdef __cplusplus extern "C" { -#endif #ifdef DEBUG #define DEBUG_PRINT(fmt, ...) \ @@ -65,9 +59,7 @@ } hsa_signal_t; #endif -#ifdef __cplusplus } -#endif /* --------------------------------------------------------------------------------- * Simulated CPU Data Structures and API diff --git a/openmp/libomptarget/plugins/amdgpu/impl/machine.h b/openmp/libomptarget/plugins/amdgpu/impl/machine.h --- a/openmp/libomptarget/plugins/amdgpu/impl/machine.h +++ b/openmp/libomptarget/plugins/amdgpu/impl/machine.h @@ -6,9 +6,8 @@ #ifndef SRC_RUNTIME_INCLUDE_MACHINE_H_ #define SRC_RUNTIME_INCLUDE_MACHINE_H_ #include "atmi.h" +#include "hsa_api.h" #include "internal.h" -#include -#include #include class ATLMemory; diff --git a/openmp/libomptarget/plugins/amdgpu/impl/machine.cpp b/openmp/libomptarget/plugins/amdgpu/impl/machine.cpp --- a/openmp/libomptarget/plugins/amdgpu/impl/machine.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/machine.cpp @@ -5,10 +5,9 @@ *===------------------------------------------------------------------------*/ #include "machine.h" #include "atmi_runtime.h" +#include "hsa_api.h" #include "internal.h" #include -#include -#include #include #include #include diff --git a/openmp/libomptarget/plugins/amdgpu/impl/rt.h b/openmp/libomptarget/plugins/amdgpu/impl/rt.h --- a/openmp/libomptarget/plugins/amdgpu/impl/rt.h +++ b/openmp/libomptarget/plugins/amdgpu/impl/rt.h @@ -7,7 +7,7 @@ #define SRC_RUNTIME_INCLUDE_RT_H_ #include "atmi_runtime.h" -#include "hsa.h" +#include "hsa_api.h" #include namespace core { diff --git a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp --- a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp +++ b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include