brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 9540893 Raw
69 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9// API to query the global (constant) device environment.10//11//===----------------------------------------------------------------------===//12 13#ifndef OMPTARGET_CONFIGURATION_H14#define OMPTARGET_CONFIGURATION_H15 16#include "Shared/Environment.h"17 18#include "DeviceTypes.h"19 20namespace ompx {21namespace config {22 23/// Return the number of devices in the system, same number as returned on the24/// host by omp_get_num_devices.25uint32_t getNumDevices();26 27/// Return the device number in the system for omp_get_device_num.28uint32_t getDeviceNum();29 30/// Return the user chosen debug level.31uint32_t getDebugKind();32 33/// Return if teams oversubscription is assumed34uint32_t getAssumeTeamsOversubscription();35 36/// Return if threads oversubscription is assumed37uint32_t getAssumeThreadsOversubscription();38 39/// Return the amount of dynamic shared memory that was allocated at launch.40uint64_t getDynamicMemorySize();41 42/// Returns the cycles per second of the device's fixed frequency clock.43uint64_t getClockFrequency();44 45/// Returns the pointer to the beginning of the indirect call table.46void *getIndirectCallTablePtr();47 48/// Returns the size of the indirect call table.49uint64_t getIndirectCallTableSize();50 51/// Returns the size of the indirect call table.52uint64_t getHardwareParallelism();53 54/// Return if debugging is enabled for the given debug kind.55bool isDebugMode(DeviceDebugKind Level);56 57/// Indicates if this kernel may require thread-specific states, or if it was58/// explicitly disabled by the user.59bool mayUseThreadStates();60 61/// Indicates if this kernel may require data environments for nested62/// parallelism, or if it was explicitly disabled by the user.63bool mayUseNestedParallelism();64 65} // namespace config66} // namespace ompx67 68#endif69