clang 24.0.0git
__clang_gpu_runtime_wrapper.h
Go to the documentation of this file.
1//===---- __clang_gpu_runtime_wrapper.h - Hermetic HIP/CUDA bootstrap ------===
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// Dialect-neutral bootstrap shared by the hermetic HIP and CUDA offload paths.
10// It establishes only the device attribute macros the vendor headers expect and
11// pulls in no device code.
12
13#ifndef __CLANG_GPU_RUNTIME_WRAPPER_H__
14#define __CLANG_GPU_RUNTIME_WRAPPER_H__
15
16#if defined(__HIP__) || defined(__CUDA__)
17
18#ifndef __device__
19#define __host__ __attribute__((host))
20#define __device__ __attribute__((device))
21#define __global__ __attribute__((global))
22#define __shared__ __attribute__((shared))
23#define __constant__ __attribute__((constant))
24#define __managed__ __attribute__((managed))
25#endif
26
27#endif // defined(__HIP__) || defined(__CUDA__)
28#endif // __CLANG_GPU_RUNTIME_WRAPPER_H__