aboutsummaryrefslogtreecommitdiff
path: root/rc3/libomptarget/deviceRTLs/nvptx/src/critical.cu
diff options
context:
space:
mode:
Diffstat (limited to 'rc3/libomptarget/deviceRTLs/nvptx/src/critical.cu')
-rw-r--r--rc3/libomptarget/deviceRTLs/nvptx/src/critical.cu30
1 files changed, 30 insertions, 0 deletions
diff --git a/rc3/libomptarget/deviceRTLs/nvptx/src/critical.cu b/rc3/libomptarget/deviceRTLs/nvptx/src/critical.cu
new file mode 100644
index 0000000..9bf2a30
--- /dev/null
+++ b/rc3/libomptarget/deviceRTLs/nvptx/src/critical.cu
@@ -0,0 +1,30 @@
+//===------ critical.cu - NVPTX OpenMP critical ------------------ CUDA -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.txt for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the implementation of critical with KMPC interface
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+
+#include "omptarget-nvptx.h"
+
+EXTERN
+void __kmpc_critical(kmp_Ident *loc, int32_t global_tid,
+ kmp_CriticalName *lck) {
+ PRINT0(LD_IO, "call to kmpc_critical()\n");
+ omp_set_lock((omp_lock_t *)lck);
+}
+
+EXTERN
+void __kmpc_end_critical(kmp_Ident *loc, int32_t global_tid,
+ kmp_CriticalName *lck) {
+ PRINT0(LD_IO, "call to kmpc_end_critical()\n");
+ omp_unset_lock((omp_lock_t *)lck);
+}