[Openmp-commits] [openmp] d0b9ed5 - [libomptarget][nfc] Move omptarget-nvptx under common
Jon Chesterfield via Openmp-commits
openmp-commits at lists.llvm.org
Thu Dec 5 12:34:30 PST 2019
Author: Jon Chesterfield
Date: 2019-12-05T20:34:15Z
New Revision: d0b9ed5c490ef10e4af750720a65a6cc6ba41af2
URL: https://github.com/llvm/llvm-project/commit/d0b9ed5c490ef10e4af750720a65a6cc6ba41af2
DIFF: https://github.com/llvm/llvm-project/commit/d0b9ed5c490ef10e4af750720a65a6cc6ba41af2.diff
LOG: [libomptarget][nfc] Move omptarget-nvptx under common
Summary:
[libomptarget][nfc] Move omptarget-nvptx under common
Almost all files depend on require omptarget-nvptx, which no longer
contains any obviously architecture dependent code. Moving it under
common unblocks task/loop for amdgcn, and allows moving other code.
At some point there should probably be a widespread symbol renaming to
replace the nvptx string. I'd prefer to get things working first.
Building this (and task.cu, loop.cu) without a cuda library requires
some more refactoring, e.g. wrap threadfence(), use DEVICE macro more
consistently. Patches for that are orthogonal and will be posted shortly.
Reviewers: jdoerfert, ABataev, grokos
Reviewed By: ABataev
Subscribers: mgorny, fedor.sergeev, jfb, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D71073
Added:
openmp/libomptarget/deviceRTLs/common/omptarget.h
openmp/libomptarget/deviceRTLs/common/omptargeti.h
openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
Modified:
openmp/libomptarget/deviceRTLs/common/src/loop.cu
openmp/libomptarget/deviceRTLs/common/src/task.cu
openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu
openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu
openmp/libomptarget/deviceRTLs/nvptx/src/support.cu
openmp/libomptarget/deviceRTLs/nvptx/src/sync.cu
Removed:
openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptxi.h
################################################################################
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h b/openmp/libomptarget/deviceRTLs/common/omptarget.h
similarity index 98%
rename from openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
rename to openmp/libomptarget/deviceRTLs/common/omptarget.h
index 51e88adee6d0..5e3c02b15342 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
+++ b/openmp/libomptarget/deviceRTLs/common/omptarget.h
@@ -1,4 +1,4 @@
-//===---- omptarget-nvptx.h - NVPTX OpenMP GPU initialization ---- CUDA -*-===//
+//===---- omptarget.h - OpenMP GPU initialization ---------------- CUDA -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef __OMPTARGET_NVPTX_H
-#define __OMPTARGET_NVPTX_H
+#ifndef OMPTARGET_H
+#define OMPTARGET_H
// std includes
#include <inttypes.h>
@@ -383,6 +383,6 @@ INLINE omptarget_nvptx_TaskDescr *getMyTopTaskDescriptor(int globalThreadId);
// inlined implementation
////////////////////////////////////////////////////////////////////////////////
-#include "omptarget-nvptxi.h"
+#include "common/omptargeti.h"
#endif
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptxi.h b/openmp/libomptarget/deviceRTLs/common/omptargeti.h
similarity index 99%
rename from openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptxi.h
rename to openmp/libomptarget/deviceRTLs/common/omptargeti.h
index e4efa1808081..b952a8dc484a 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptxi.h
+++ b/openmp/libomptarget/deviceRTLs/common/omptargeti.h
@@ -1,4 +1,4 @@
-//===---- omptarget-nvptxi.h - NVPTX OpenMP GPU initialization --- CUDA -*-===//
+//===---- omptargeti.h - OpenMP GPU initialization --------------- CUDA -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/openmp/libomptarget/deviceRTLs/common/src/loop.cu b/openmp/libomptarget/deviceRTLs/common/src/loop.cu
index 3eff3a15bd46..45bf8f40a929 100644
--- a/openmp/libomptarget/deviceRTLs/common/src/loop.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/loop.cu
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "target_impl.h"
////////////////////////////////////////////////////////////////////////////////
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu b/openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
similarity index 98%
rename from openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
rename to openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
index 0481bdf854fb..f99156cca447 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
@@ -1,4 +1,4 @@
-//===--- omptarget-nvptx.cu - NVPTX OpenMP GPU initialization ---- CUDA -*-===//
+//===--- omptarget.cu - OpenMP GPU initialization ---------------- CUDA -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "target_impl.h"
////////////////////////////////////////////////////////////////////////////////
diff --git a/openmp/libomptarget/deviceRTLs/common/src/task.cu b/openmp/libomptarget/deviceRTLs/common/src/task.cu
index d618ff16de18..d04ec50afd37 100644
--- a/openmp/libomptarget/deviceRTLs/common/src/task.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/task.cu
@@ -27,7 +27,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
EXTERN kmp_TaskDescr *__kmpc_omp_task_alloc(
kmp_Ident *loc, // unused
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
index c3b2db05c3a2..eaf4c11d086a 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -56,7 +56,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND)
src/data_sharing.cu
src/libcall.cu
${devicertl_common_directory}/src/loop.cu
- src/omptarget-nvptx.cu
+ ${devicertl_common_directory}/src/omptarget.cu
src/parallel.cu
src/reduction.cu
src/support.cu
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
index f2892acb790a..43d6cc12f95e 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
@@ -9,7 +9,7 @@
// This file contains the implementation of data sharing environments/
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "target_impl.h"
#include <stdio.h>
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
index e86b1d1fdbf3..d8656f345916 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
@@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
// Timer precision is 1ns
#define TIMER_PRECISION ((double)1E-9)
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu
index 46ed8f4ef343..4d3701e8f076 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu
@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "common/device_environment.h"
////////////////////////////////////////////////////////////////////////////////
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
index aa0172778661..02106f5ec745 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
@@ -32,7 +32,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "target_impl.h"
typedef struct ConvergentSimdJob {
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu
index da7204df4122..1bedb2379ca7 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu
@@ -14,7 +14,7 @@
#include <complex.h>
#include <stdio.h>
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "target_impl.h"
EXTERN
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/support.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/support.cu
index b5efa632b004..10c9c0930cf2 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/support.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/support.cu
@@ -12,7 +12,7 @@
#include "common/support.h"
#include "common/debug.h"
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
////////////////////////////////////////////////////////////////////////////////
// Execution Parameters
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/sync.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/sync.cu
index f36e877bff1c..808e747875fa 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/src/sync.cu
+++ b/openmp/libomptarget/deviceRTLs/nvptx/src/sync.cu
@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
-#include "omptarget-nvptx.h"
+#include "common/omptarget.h"
#include "target_impl.h"
////////////////////////////////////////////////////////////////////////////////
More information about the Openmp-commits
mailing list