clang 20.0.0git
__llvm_offload.h
Go to the documentation of this file.
1/*===------ LLVM/Offload helpers for kernel languages (CUDA/HIP) -*- 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
10#include <stddef.h>
11
12#define __host__ __attribute__((host))
13#define __device__ __attribute__((device))
14#define __global__ __attribute__((global))
15#define __shared__ __attribute__((shared))
16#define __constant__ __attribute__((constant))
17#define __managed__ __attribute__((managed))
18
19extern "C" {
20
21typedef struct dim3 {
22 dim3() {}
23 dim3(unsigned x) : x(x) {}
24 unsigned x = 0, y = 0, z = 0;
26
27// TODO: For some reason the CUDA device compilation requires this declaration
28// to be present on the device while it is only used on the host.
30 size_t sharedMem = 0, void *stream = 0);
31}
__CUDA_BUILTIN_VAR __cuda_builtin_blockDim_t blockDim
__CUDA_BUILTIN_VAR __cuda_builtin_gridDim_t gridDim
unsigned __llvmPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem=0, void *stream=0)
dim3(unsigned x)
unsigned y
unsigned z
unsigned x