[Openmp-commits] [PATCH] D71412: [libomptarget][nfc] Add declarations of atomic functions for amdgcn
Jon Chesterfield via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Dec 12 14:52:12 PST 2019
JonChesterfield updated this revision to Diff 233688.
JonChesterfield added a comment.
- add header guards
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71412/new/
https://reviews.llvm.org/D71412
Files:
openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
openmp/libomptarget/deviceRTLs/amdgcn/src/hip_atomics.h
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
Index: openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
===================================================================
--- openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
+++ openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
@@ -27,6 +27,8 @@
#define SHARED __attribute__((shared))
#define ALIGN(N) __attribute__((aligned(N)))
+#include "hip_atomics.h"
+
////////////////////////////////////////////////////////////////////////////////
// Kernel options
////////////////////////////////////////////////////////////////////////////////
Index: openmp/libomptarget/deviceRTLs/amdgcn/src/hip_atomics.h
===================================================================
--- /dev/null
+++ openmp/libomptarget/deviceRTLs/amdgcn/src/hip_atomics.h
@@ -0,0 +1,39 @@
+//===---- hip_atomics.h - Declarations of hip atomic functions ---- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef OMPTARGET_AMDGCN_HIP_ATOMICS_H
+#define OMPTARGET_AMDGCN_HIP_ATOMICS_H
+
+#include "target_impl.h"
+
+DEVICE unsigned atomicAdd(unsigned *address, unsigned val);
+DEVICE int atomicAdd(int *address, int val);
+DEVICE unsigned long long atomicAdd(unsigned long long *address,
+ unsigned long long val);
+
+DEVICE unsigned atomicInc(unsigned *address);
+DEVICE unsigned atomicInc(unsigned *address, unsigned max);
+DEVICE int atomicInc(int *address);
+
+DEVICE int atomicMax(int *address, int val);
+DEVICE unsigned atomicMax(unsigned *address, unsigned val);
+DEVICE unsigned long long atomicMax(unsigned long long *address,
+ unsigned long long val);
+
+DEVICE int atomicExch(int *address, int val);
+DEVICE unsigned atomicExch(unsigned *address, unsigned val);
+DEVICE unsigned long long atomicExch(unsigned long long *address,
+ unsigned long long val);
+
+DEVICE unsigned atomicCAS(unsigned *address, unsigned compare, unsigned val);
+DEVICE int atomicCAS(int *address, int compare, int val);
+DEVICE unsigned long long atomicCAS(unsigned long long *address,
+ unsigned long long compare,
+ unsigned long long val);
+
+#endif
Index: openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
===================================================================
--- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
@@ -60,6 +60,7 @@
set(h_files
${CMAKE_CURRENT_SOURCE_DIR}/src/amdgcn_interface.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/hip_atomics.h
${CMAKE_CURRENT_SOURCE_DIR}/src/target_impl.h
${devicertl_base_directory}/common/debug.h
${devicertl_base_directory}/common/device_environment.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71412.233688.patch
Type: text/x-patch
Size: 3013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20191212/65d662e5/attachment.bin>
More information about the Openmp-commits
mailing list