Kokkos Core Kernels Package Version of the Day
Loading...
Searching...
No Matches
Kokkos_MasterLock.hpp
1//@HEADER
2// ************************************************************************
3//
4// Kokkos v. 4.0
5// Copyright (2022) National Technology & Engineering
6// Solutions of Sandia, LLC (NTESS).
7//
8// Under the terms of Contract DE-NA0003525 with NTESS,
9// the U.S. Government retains certain rights in this software.
10//
11// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12// See https://kokkos.org/LICENSE for license information.
13// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14//
15//@HEADER
16
17#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18#include <Kokkos_Macros.hpp>
19static_assert(false,
20 "Including non-public Kokkos header files is not allowed.");
21#endif
22#ifndef KOKKOS_MASTER_LOCK_HPP
23#define KOKKOS_MASTER_LOCK_HPP
24
25#include <Kokkos_Macros.hpp>
26
27#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
28
29namespace Kokkos {
30namespace Experimental {
31
32// my be used to coordinate work between master instances
33// SHOULD NOT be used within a parallel algorithm
34//
35// This lock should be used with with a scoped lock guard
36// i.e. std::unique_lock<Lock>, std::lock_guard
37//
38// cannot be copied or moved
39// has the following functions available
40//
41// Lock()
42// ~Lock()
43//
44// void lock()
45// void unlock()
46// bool try_lock()
47//
48template <typename ExecutionSpace>
49class MasterLock;
50
51} // namespace Experimental
52} // namespace Kokkos
53
54#endif
55
56#endif // KOKKOS_MASTER_LOCK_HPP