Skip to content

Commit

Permalink
Revert "[libomptarget] Build a minimal deviceRTL for amdgcn"
Browse files Browse the repository at this point in the history
This reverts commit 877ffa7 because it
breaks the build.
  • Loading branch information
alexey-bataev committed Dec 3, 2019
1 parent abe8de2 commit 02b9c5d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 183 deletions.
3 changes: 1 addition & 2 deletions openmp/libomptarget/deviceRTLs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
#
# ##===----------------------------------------------------------------------===##
#
# Build a device RTL for each available machine.
# Build a device RTL for each available machine available.
#
##===----------------------------------------------------------------------===##

add_subdirectory(amdgcn)
add_subdirectory(nvptx)
136 changes: 0 additions & 136 deletions openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt

This file was deleted.

27 changes: 0 additions & 27 deletions openmp/libomptarget/deviceRTLs/amdgcn/src/device_environment.h

This file was deleted.

31 changes: 13 additions & 18 deletions openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ EXTERN uint64_t __lanemask_lt();
// thread's lane number in the warp
EXTERN uint64_t __lanemask_gt();

EXTERN void llvm_amdgcn_s_barrier();

// CU id
EXTERN unsigned __smid();

Expand Down Expand Up @@ -99,21 +101,25 @@ INLINE uint32_t __kmpc_impl_smid() {
return __smid();
}

INLINE uint64_t __kmpc_impl_ffs(uint64_t x) { return __builtin_ffsl(x); }
INLINE uint64_t __kmpc_impl_ffs(uint64_t x) { return __ffsll(x); }

INLINE uint64_t __kmpc_impl_popc(uint64_t x) { return __builtin_popcountl(x); }
INLINE uint64_t __kmpc_impl_popc(uint64_t x) { return __popcll(x); }

INLINE __kmpc_impl_lanemask_t __kmpc_impl_activemask() {
return __ballot64(1);
}

EXTERN int32_t __kmpc_impl_shfl_sync(__kmpc_impl_lanemask_t, int32_t Var,
int32_t SrcLane);
INLINE int32_t __kmpc_impl_shfl_sync(__kmpc_impl_lanemask_t, int32_t Var,
int32_t SrcLane) {
return __shfl(Var, SrcLane, WARPSIZE);
}

EXTERN int32_t __kmpc_impl_shfl_down_sync(__kmpc_impl_lanemask_t, int32_t Var,
uint32_t Delta, int32_t Width);
INLINE int32_t __kmpc_impl_shfl_down_sync(__kmpc_impl_lanemask_t, int32_t Var,
uint32_t Delta, int32_t Width) {
return __shfl_down(Var, Delta, Width);
}

INLINE void __kmpc_impl_syncthreads() { __builtin_amdgcn_s_barrier(); }
INLINE void __kmpc_impl_syncthreads() { llvm_amdgcn_s_barrier(); }

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

// DEVICE versions of part of libc
extern "C" {
DEVICE __attribute__((noreturn)) void
__assertfail(const char *, const char *, unsigned, const char *, size_t);
INLINE static void __assert_fail(const char *__message, const char *__file,
unsigned int __line, const char *__function) {
__assertfail(__message, __file, __line, __function, sizeof(char));
}
DEVICE int printf(const char *, ...);
}

#endif

0 comments on commit 02b9c5d

Please sign in to comment.