diff --git a/openmp/libomptarget/deviceRTLs/interface.h b/openmp/libomptarget/deviceRTLs/interface.h --- a/openmp/libomptarget/deviceRTLs/interface.h +++ b/openmp/libomptarget/deviceRTLs/interface.h @@ -16,6 +16,7 @@ #ifndef _INTERFACES_H_ #define _INTERFACES_H_ +#include #include #ifdef __CUDACC__ diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu --- a/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/cancel.cu @@ -10,7 +10,8 @@ // //===----------------------------------------------------------------------===// -#include "omptarget-nvptx.h" +#include "interface.h" +#include "debug.h" EXTERN int32_t __kmpc_cancellationpoint(kmp_Ident *loc, int32_t global_tid, int32_t cancelVal) { diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/critical.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/critical.cu --- a/openmp/libomptarget/deviceRTLs/nvptx/src/critical.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/critical.cu @@ -10,9 +10,8 @@ // //===----------------------------------------------------------------------===// -#include - -#include "omptarget-nvptx.h" +#include "interface.h" +#include "debug.h" EXTERN void __kmpc_critical(kmp_Ident *loc, int32_t global_tid, diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h b/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h --- a/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/debug.h @@ -28,6 +28,8 @@ #ifndef _OMPTARGET_NVPTX_DEBUG_H_ #define _OMPTARGET_NVPTX_DEBUG_H_ +#include "device_environment.h" + //////////////////////////////////////////////////////////////////////////////// // set desired level of debugging //////////////////////////////////////////////////////////////////////////////// diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/device_environment.h b/openmp/libomptarget/deviceRTLs/nvptx/src/device_environment.h new file mode 100644 --- /dev/null +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/device_environment.h @@ -0,0 +1,24 @@ +//===---- device_environment.h - OpenMP GPU device environment --- CUDA -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// Global device environment +// +//===----------------------------------------------------------------------===// + +#ifndef _OMPTARGET_DEVICE_ENVIRONMENT_H_ +#define _OMPTARGET_DEVICE_ENVIRONMENT_H_ + +#include "target_impl.h" + +struct omptarget_device_environmentTy { + int32_t debug_level; +}; + +extern __device__ omptarget_device_environmentTy omptarget_device_environment; + +#endif diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu --- a/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu @@ -11,9 +11,10 @@ //===----------------------------------------------------------------------===// #include "omptarget-nvptx.h" +#include "device_environment.h" //////////////////////////////////////////////////////////////////////////////// -// global device envrionment +// global device environment //////////////////////////////////////////////////////////////////////////////// __device__ omptarget_device_environmentTy omptarget_device_environment; diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h b/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h --- a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h @@ -324,11 +324,6 @@ uint64_t cnt; }; -/// Device envrionment data -struct omptarget_device_environmentTy { - int32_t debug_level; -}; - /// Memory manager for statically allocated memory. class omptarget_nvptx_SimpleMemoryManager { private: @@ -346,12 +341,6 @@ }; //////////////////////////////////////////////////////////////////////////////// -// global device envrionment -//////////////////////////////////////////////////////////////////////////////// - -extern __device__ omptarget_device_environmentTy omptarget_device_environment; - -//////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // global data tables