9#ifndef __CLANG_GPU_BUILTIN_VARS_H__
10#define __CLANG_GPU_BUILTIN_VARS_H__
12#if defined(__HIP__) || defined(__CUDA__)
16#pragma push_macro("__GPU_DISALLOW_BUILTINVAR_ACCESS")
17#define __GPU_DISALLOW_BUILTINVAR_ACCESS(__tag) \
18 __attribute__((device)) __tag() = delete; \
19 __attribute__((device)) __tag(const __tag &) = delete; \
20 __attribute__((device)) void operator=(const __tag &) const = delete; \
21 __attribute__((device)) __tag *operator&() const = delete
23#pragma push_macro("__GPU_COORD_BUILTIN")
24#define __GPU_COORD_BUILTIN(__tag, __fx, __fy, __fz) \
26 __declspec(property(get = __get_x)) unsigned int x; \
27 __declspec(property(get = __get_y)) unsigned int y; \
28 __declspec(property(get = __get_z)) unsigned int z; \
29 __attribute__((device, always_inline)) unsigned int __get_x() const { \
32 __attribute__((device, always_inline)) unsigned int __get_y() const { \
35 __attribute__((device, always_inline)) unsigned int __get_z() const { \
40 __GPU_DISALLOW_BUILTINVAR_ACCESS(__tag); \
52#pragma pop_macro("__GPU_COORD_BUILTIN")
53#pragma pop_macro("__GPU_DISALLOW_BUILTINVAR_ACCESS")
__CUDA_BUILTIN_VAR __cuda_builtin_blockDim_t blockDim
__CUDA_BUILTIN_VAR __cuda_builtin_gridDim_t gridDim
__CUDA_BUILTIN_VAR __cuda_builtin_blockIdx_t blockIdx
__CUDA_BUILTIN_VAR __cuda_builtin_threadIdx_t threadIdx
_Float16 __2f16 __attribute__((ext_vector_type(2)))
Zeroes the upper 128 bits (bits 255:128) of all YMM registers.
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_thread_id_x(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_num_threads_z(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_block_id_y(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_thread_id_z(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_num_blocks_x(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_block_id_z(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_num_threads_y(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_num_threads_x(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_thread_id_y(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_num_blocks_z(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_block_id_x(void)
static _DEFAULT_FN_ATTRS __inline__ uint32_t __gpu_num_blocks_y(void)