Skip to content

[SYCL][HIP][libclc] Revert revert "Fix wrong address spaces for HIP" #5293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/AMDGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
case OCLTK_Queue:
case OCLTK_ReserveID:
return LangAS::opencl_global;
case OCLTK_Event:
return LangAS::opencl_private;

default:
return TargetInfo::getOpenCLTypeAddrSpace(TK);
Expand Down
1 change: 1 addition & 0 deletions libclc/amdgcn-amdhsa/libspirv/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ workitem/get_sub_group_id.cl
workitem/get_sub_group_local_id.cl
workitem/get_sub_group_size.cl
misc/sub_group_shuffle.cl
async/wait_group_events.cl
22 changes: 22 additions & 0 deletions libclc/amdgcn-amdhsa/libspirv/async/wait_group_events.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <spirv/spirv.h>

_CLC_DEF void _Z23__spirv_GroupWaitEventsjiP9ocl_event(unsigned int scope,
int num_events,
event_t __attribute__((address_space(0)))* event_list) {
__spirv_ControlBarrier(scope, Workgroup, SequentiallyConsistent);
}

_CLC_OVERLOAD _CLC_DEF void __spirv_GroupWaitEvents(unsigned int scope,
int num_events,
event_t *event_list) {
__spirv_ControlBarrier(scope, Workgroup, SequentiallyConsistent);
}