Skip to content

Commit 239f482

Browse files
committed
Fix OpenCL
1 parent d48b335 commit 239f482

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/Headers/amdgpuintrin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ __gpu_shuffle_idx_u64(uint64_t __lane_mask, uint32_t __idx, uint64_t __x) {
161161
// Returns true if the flat pointer points to CUDA 'shared' memory.
162162
_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(void *ptr) {
163163
return __builtin_amdgcn_is_shared(
164-
(void __attribute__((address_space(0))) *)ptr);
164+
(void __attribute__((address_space(0))) *)((void __gpu_generic *)ptr));
165165
}
166166

167167
// Returns true if the flat pointer points to CUDA 'local' memory.
168168
_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(void *ptr) {
169169
return __builtin_amdgcn_is_private(
170-
(void __attribute__((address_space(0))) *)ptr);
170+
(void __attribute__((address_space(0))) *)((void __gpu_generic *)ptr));
171171
}
172172

173173
// Terminates execution of the associated wavefront.

clang/test/Headers/gpuintrin_lang.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//
1414
// RUN: %clang_cc1 -internal-isystem %S/Inputs/include \
1515
// RUN: -internal-isystem %S/../../lib/Headers/ \
16-
// RUN: -cl-std=CL2.0 -triple amdgcn -emit-llvm %s -o - \
16+
// RUN: -cl-std=CL3.0 -triple amdgcn -emit-llvm %s -o - \
1717
// RUN: | FileCheck %s --check-prefix=OPENCL
1818
//
1919
// RUN: %clang_cc1 -internal-isystem %S/Inputs/include \
@@ -62,7 +62,7 @@ __device__ int foo() { return __gpu_thread_id_x(); }
6262
// OPENMP-NEXT: ret i32 [[TMP0]]
6363
//
6464
// C89-LABEL: define dso_local i32 @foo(
65-
// C89-SAME: ) #[[ATTR0:[0-9]+]] {
65+
// C89-SAME: ) #[[ATTR2:[0-9]+]] {
6666
// C89-NEXT: [[ENTRY:.*:]]
6767
// C89-NEXT: [[RETVAL_I:%.*]] = alloca i32, align 4, addrspace(5)
6868
// C89-NEXT: [[RETVAL:%.*]] = alloca i32, align 4, addrspace(5)

0 commit comments

Comments
 (0)