summaryrefslogtreecommitdiffstats
path: root/openmp/libomptarget/deviceRTLs/common/src/critical.cu
blob: ee4b056ddad92e51e9080433f383e122f1742932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//===------ critical.cu - NVPTX OpenMP critical ------------------ CUDA -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file contains the implementation of critical with KMPC interface
//
//===----------------------------------------------------------------------===//

#include "interface.h"
#include "common/debug.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);
}
OpenPOWER on IntegriCloud