clang 24.0.0git
CIROpenACCUtils.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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// This file contains CIR OpenACC utilities.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CLANG_CIR_DIALECT_OPENACC_CIROPENACCUTILS_H
14#define CLANG_CIR_DIALECT_OPENACC_CIROPENACCUTILS_H
15
17
18namespace cir::acc {
19
20/// Returns true if code on the device can reach storage in `space`. This
21/// includes host memory the device accesses directly (`offload_global_host`)
22/// and `offload_generic`, which may name device memory.
23bool isDeviceAccessibleAddressSpace(cir::LangAddressSpace space);
24
25/// Returns true if storage in `space` physically resides on the device. This
26/// is a subset of `isDeviceAccessibleAddressSpace`: host memory and generic
27/// pointers are reachable but not resident.
28bool isDeviceResidentAddressSpace(cir::LangAddressSpace space);
29
30} // namespace cir::acc
31
32#endif // CLANG_CIR_DIALECT_OPENACC_CIROPENACCUTILS_H
bool isDeviceResidentAddressSpace(cir::LangAddressSpace space)
Returns true if storage in space physically resides on the device.
bool isDeviceAccessibleAddressSpace(cir::LangAddressSpace space)
Returns true if code on the device can reach storage in space.