[nfc][libomptarget] Decrease coupling between files
Summary: [nfc][libomptarget] Decrease coupling between files debug.h used the symbol omptarget_device_environment so implicitly required an include of omptarget-nvptx.h to compile. Similarly interface.h uses size_t. Moving this declaration to a new header means cancel, critical can now build without omptarget-nvptx.h. After this change, debug.h, cancel.cu, critical.cu could move under a common source directory. Reviewers: ABataev, jdoerfert, grokos Subscribers: openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D69473
This commit is contained in:
parent
ad4c42666d
commit
174967f153
|
|
@ -16,6 +16,7 @@
|
|||
#ifndef _INTERFACES_H_
|
||||
#define _INTERFACES_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __CUDACC__
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "omptarget-nvptx.h"
|
||||
#include "interface.h"
|
||||
#include "debug.h"
|
||||
|
||||
EXTERN
|
||||
void __kmpc_critical(kmp_Ident *loc, int32_t global_tid,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
#ifndef _OMPTARGET_NVPTX_DEBUG_H_
|
||||
#define _OMPTARGET_NVPTX_DEBUG_H_
|
||||
|
||||
#include "device_environment.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// set desired level of debugging
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -324,11 +324,6 @@ private:
|
|||
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:
|
||||
|
|
@ -345,12 +340,6 @@ public:
|
|||
INLINE const void *Acquire(const void *buf, size_t size);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// global device envrionment
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern __device__ omptarget_device_environmentTy omptarget_device_environment;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue