Skip to content

Commit 03970cc

Browse files
authored
[SYCL][HIP][libclc] Revert revert "Fix wrong address spaces for HIP" (#5293)
Reverts #5284 , reintroducing the reverted #4966 and adds fixes the failing libclc test.
1 parent 1030396 commit 03970cc

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
_CLC_OVERLOAD _CLC_DEF void __spirv_GroupWaitEvents(unsigned int scope,
18+
int num_events,
19+
event_t *event_list) {
20+
__spirv_ControlBarrier(scope, Workgroup, SequentiallyConsistent);
21+
}
22+

0 commit comments

Comments
 (0)