forked from kokkos/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kokkos_OpenACC_Instance.hpp
59 lines (42 loc) · 1.48 KB
/
Kokkos_OpenACC_Instance.hpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//@HEADER
// ************************************************************************
//
// Kokkos v. 4.0
// Copyright (2022) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
// See https://kokkos.org/LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//@HEADER
#ifndef KOKKOS_OPENACC_INSTANCE_HPP
#define KOKKOS_OPENACC_INSTANCE_HPP
#include <impl/Kokkos_InitializationSettings.hpp>
#include <openacc.h>
#include <cstdint>
#include <iosfwd>
#include <string>
namespace Kokkos::Experimental::Impl {
class OpenACCInternal {
bool m_is_initialized = false;
OpenACCInternal(const OpenACCInternal&) = default;
OpenACCInternal& operator=(const OpenACCInternal&) = default;
public:
static int m_acc_device_num;
int m_async_arg = acc_async_noval;
OpenACCInternal() = default;
static OpenACCInternal& singleton();
bool verify_is_initialized(const char* const label) const;
void initialize(int async_arg = acc_async_noval);
void finalize();
bool is_initialized() const;
void print_configuration(std::ostream& os, bool verbose = false) const;
void fence(std::string const& name) const;
uint32_t instance_id() const noexcept;
};
} // namespace Kokkos::Experimental::Impl
#endif