1 //===--- Configuration.h - OpenMP device configuration interface -- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // API to query the global (constant) device environment.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef OMPTARGET_CONFIGURATION_H
14 #define OMPTARGET_CONFIGURATION_H
15 
16 #include "Types.h"
17 
18 namespace _OMP {
19 namespace config {
20 
21 enum DebugKind : uint32_t {
22   Assertion = 1U << 0,
23   FunctionTracing = 1U << 1,
24 };
25 
26 /// Return the number of devices in the system, same number as returned on the
27 /// host by omp_get_num_devices.
28 uint32_t getNumDevices();
29 
30 /// Return the number of devices in the system, same number as returned on the
31 /// host by omp_get_num_devices.
32 uint32_t getDeviceNum();
33 
34 /// Return the user choosen debug level.
35 uint32_t getDebugKind();
36 
37 /// Return the amount of dynamic shared memory that was allocated at launch.
38 uint64_t getDynamicMemorySize();
39 
40 bool isDebugMode(DebugKind Level);
41 
42 } // namespace config
43 } // namespace _OMP
44 
45 #endif
46