Skip to content

Commit 02b9c5d

Browse files
committed
Revert "[libomptarget] Build a minimal deviceRTL for amdgcn"
This reverts commit 877ffa7 because it breaks the build.
1 parent abe8de2 commit 02b9c5d

File tree

5 files changed

+14
-183
lines changed

5 files changed

+14
-183
lines changed

openmp/libomptarget/deviceRTLs/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
#
77
# ##===----------------------------------------------------------------------===##
88
#
9-
# Build a device RTL for each available machine.
9+
# Build a device RTL for each available machine available.
1010
#
1111
##===----------------------------------------------------------------------===##
1212

13-
add_subdirectory(amdgcn)
1413
add_subdirectory(nvptx)

openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt

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

openmp/libomptarget/deviceRTLs/amdgcn/src/device_environment.h

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

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

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ EXTERN uint64_t __lanemask_lt();
7272
// thread's lane number in the warp
7373
EXTERN uint64_t __lanemask_gt();
7474

75+
EXTERN void llvm_amdgcn_s_barrier();
76+
7577
// CU id
7678
EXTERN unsigned __smid();
7779

@@ -99,21 +101,25 @@ INLINE uint32_t __kmpc_impl_smid() {
99101
return __smid();
100102
}
101103

102-
INLINE uint64_t __kmpc_impl_ffs(uint64_t x) { return __builtin_ffsl(x); }
104+
INLINE uint64_t __kmpc_impl_ffs(uint64_t x) { return __ffsll(x); }
103105

104-
INLINE uint64_t __kmpc_impl_popc(uint64_t x) { return __builtin_popcountl(x); }
106+
INLINE uint64_t __kmpc_impl_popc(uint64_t x) { return __popcll(x); }
105107

106108
INLINE __kmpc_impl_lanemask_t __kmpc_impl_activemask() {
107109
return __ballot64(1);
108110
}
109111

110-
EXTERN int32_t __kmpc_impl_shfl_sync(__kmpc_impl_lanemask_t, int32_t Var,
111-
int32_t SrcLane);
112+
INLINE int32_t __kmpc_impl_shfl_sync(__kmpc_impl_lanemask_t, int32_t Var,
113+
int32_t SrcLane) {
114+
return __shfl(Var, SrcLane, WARPSIZE);
115+
}
112116

113-
EXTERN int32_t __kmpc_impl_shfl_down_sync(__kmpc_impl_lanemask_t, int32_t Var,
114-
uint32_t Delta, int32_t Width);
117+
INLINE int32_t __kmpc_impl_shfl_down_sync(__kmpc_impl_lanemask_t, int32_t Var,
118+
uint32_t Delta, int32_t Width) {
119+
return __shfl_down(Var, Delta, Width);
120+
}
115121

116-
INLINE void __kmpc_impl_syncthreads() { __builtin_amdgcn_s_barrier(); }
122+
INLINE void __kmpc_impl_syncthreads() { llvm_amdgcn_s_barrier(); }
117123

118124
INLINE void __kmpc_impl_named_sync(int barrier, uint32_t num_threads) {
119125
// we have protected the master warp from releasing from its barrier
@@ -122,15 +128,4 @@ INLINE void __kmpc_impl_named_sync(int barrier, uint32_t num_threads) {
122128
__builtin_amdgcn_s_barrier();
123129
}
124130

125-
// DEVICE versions of part of libc
126-
extern "C" {
127-
DEVICE __attribute__((noreturn)) void
128-
__assertfail(const char *, const char *, unsigned, const char *, size_t);
129-
INLINE static void __assert_fail(const char *__message, const char *__file,
130-
unsigned int __line, const char *__function) {
131-
__assertfail(__message, __file, __line, __function, sizeof(char));
132-
}
133-
DEVICE int printf(const char *, ...);
134-
}
135-
136131
#endif

0 commit comments

Comments
 (0)