Skip to content

Commit ad4c426

Browse files
[nfc][libomptarget] Inline option into target_impl
Summary: [nfc][libomptarget] Inline option into target_impl Subset of D69423. The macros that were in option.h are all target dependent. Inlining the header simplifies the dependency graph when looking to move code into a common subdir. Reviewers: ABataev, jdoerfert, grokos Subscribers: openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D69472
1 parent 4640223 commit ad4c426

File tree

5 files changed

+38
-66
lines changed

5 files changed

+38
-66
lines changed

openmp/libomptarget/deviceRTLs/nvptx/src/debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126

127127
#if OMPTARGET_NVPTX_DEBUG || OMPTARGET_NVPTX_TEST || OMPTARGET_NVPTX_WARNING
128128
#include <stdio.h>
129-
#include "option.h"
129+
#include "target_impl.h"
130130

131131
template <typename... Arguments>
132132
NOINLINE static void log(const char *fmt, Arguments... parameters) {

openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "target_impl.h"
2424
#include "debug.h" // debug
2525
#include "interface.h" // interfaces with omp, compiler, and user
26-
#include "option.h" // choices we have
2726
#include "state-queue.h"
2827
#include "support.h"
2928

openmp/libomptarget/deviceRTLs/nvptx/src/option.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

openmp/libomptarget/deviceRTLs/nvptx/src/state-queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <stdint.h>
2323

24-
#include "option.h" // choices we have
24+
#include "target_impl.h"
2525

2626
template <typename ElementType, uint32_t SIZE> class omptarget_nvptx_Queue {
2727
private:

openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,42 @@
1515
#include <cuda.h>
1616
#include <stdint.h>
1717

18-
#include "option.h"
18+
#define INLINE __forceinline__ __device__
19+
#define NOINLINE __noinline__ __device__
20+
21+
////////////////////////////////////////////////////////////////////////////////
22+
// Kernel options
23+
////////////////////////////////////////////////////////////////////////////////
24+
25+
////////////////////////////////////////////////////////////////////////////////
26+
// The following def must match the absolute limit hardwired in the host RTL
27+
// max number of threads per team
28+
#define MAX_THREADS_PER_TEAM 1024
29+
30+
#define WARPSIZE 32
31+
32+
// The named barrier for active parallel threads of a team in an L1 parallel
33+
// region to synchronize with each other.
34+
#define L1_BARRIER (1)
35+
36+
// Maximum number of preallocated arguments to an outlined parallel/simd function.
37+
// Anything more requires dynamic memory allocation.
38+
#define MAX_SHARED_ARGS 20
39+
40+
// Maximum number of omp state objects per SM allocated statically in global
41+
// memory.
42+
#if __CUDA_ARCH__ >= 700
43+
#define OMP_STATE_COUNT 32
44+
#define MAX_SM 84
45+
#elif __CUDA_ARCH__ >= 600
46+
#define OMP_STATE_COUNT 32
47+
#define MAX_SM 56
48+
#else
49+
#define OMP_STATE_COUNT 16
50+
#define MAX_SM 16
51+
#endif
52+
53+
#define OMP_ACTIVE_PARALLEL_LEVEL 128
1954

2055
// Data sharing related quantities, need to match what is used in the compiler.
2156
enum DATA_SHARING_SIZES {

0 commit comments

Comments
 (0)