Skip to content

Commit 22532c2

Browse files
authored
[SYCL][HIP][libclc] Fix wrong address spaces for HIP (#4966)
Fixes wrong address spaces for `event_t`. It should be private, but in SYCL it was defaulting to generic. On the other hand in libclc pointer to `event_t` was private, while it should be generic. (We don't see similar issues on NVPTX, as there private address space is in fact implemented as generic in IR). Change to test suite: intel/llvm-test-suite#570
1 parent 908d556 commit 22532c2

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

clang/lib/Basic/Targets/AMDGPU.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
328328
case OCLTK_Queue:
329329
case OCLTK_ReserveID:
330330
return LangAS::opencl_global;
331+
case OCLTK_Event:
332+
return LangAS::opencl_private;
331333

332334
default:
333335
return TargetInfo::getOpenCLTypeAddrSpace(TK);

libclc/amdgcn-amdhsa/libspirv/SOURCES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ workitem/get_sub_group_id.cl
5656
workitem/get_sub_group_local_id.cl
5757
workitem/get_sub_group_size.cl
5858
misc/sub_group_shuffle.cl
59+
async/wait_group_events.cl
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//===----------------------------------------------------------------------===//
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+
#include <spirv/spirv.h>
10+
11+
_CLC_DEF void _Z23__spirv_GroupWaitEventsjiP9ocl_event(unsigned int scope,
12+
int num_events,
13+
event_t __attribute__((address_space(0)))* event_list) {
14+
__spirv_ControlBarrier(scope, Workgroup, SequentiallyConsistent);
15+
}
16+
17+

0 commit comments

Comments
 (0)