Skip to content

Commit 2386733

Browse files
committed
comments
1 parent 860b550 commit 2386733

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clang/lib/Headers/gpuintrin.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ _Pragma("push_macro(\"bool\")");
4343
_Pragma("omp begin declare target device_type(nohost)");
4444
_Pragma("omp begin declare variant match(device = {kind(gpu)})");
4545

46+
#define __GPU_X_DIM 0
47+
#define __GPU_Y_DIM 1
48+
#define __GPU_Z_DIM 2
49+
4650
// Returns the number of blocks in the requested dimension.
4751
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks(int __dim) {
4852
switch (__dim) {
@@ -127,15 +131,15 @@ __gpu_read_first_lane_f64(uint64_t __lane_mask, double __x) {
127131
__builtin_bit_cast(uint64_t, __x)));
128132
}
129133

130-
// Gets the first floating point value from the active lanes.
134+
// Shuffles the the lanes according to the given index.
131135
_DEFAULT_FN_ATTRS static __inline__ float
132136
__gpu_shuffle_idx_f32(uint64_t __lane_mask, uint32_t __idx, float __x) {
133137
return __builtin_bit_cast(
134138
float, __gpu_shuffle_idx_u32(__lane_mask, __idx,
135139
__builtin_bit_cast(uint32_t, __x)));
136140
}
137141

138-
// Gets the first floating point value from the active lanes.
142+
// Shuffles the the lanes according to the given index.
139143
_DEFAULT_FN_ATTRS static __inline__ double
140144
__gpu_shuffle_idx_f64(uint64_t __lane_mask, uint32_t __idx, double __x) {
141145
return __builtin_bit_cast(

0 commit comments

Comments
 (0)