Skip to content

Commit 1703f01

Browse files
committed
Add gpu variant for OpenMP
1 parent b942931 commit 1703f01

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Headers/gpuintrin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ _Pragma("push_macro(\"bool\")");
4141
#endif
4242

4343
_Pragma("omp begin declare target device_type(nohost)");
44+
_Pragma("omp begin declare variant match(device = {kind(gpu)})");
4445

4546
// Returns the number of blocks in the requested dimension.
4647
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks(int __dim) {
@@ -131,6 +132,7 @@ __gpu_lane_scan_u32(uint64_t __lane_mask, uint32_t x) {
131132
return x;
132133
}
133134

135+
_Pragma("omp end declare variant");
134136
_Pragma("omp end declare target");
135137

136138
#if !defined(__cplusplus)

0 commit comments

Comments
 (0)