Skip to content
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: 1 addition & 1 deletion sycl/include/CL/sycl/intel/sub_group_host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct sub_group {
}

template <typename T, access::address_space Space>
void store(multi_ptr<T, Space> dst, T &x) const {
void store(multi_ptr<T, Space> dst, const T &x) const {
throw runtime_error("Subgroups are not supported on host device. ");
}

Expand Down
16 changes: 16 additions & 0 deletions sycl/test/regression/sub-group-store-const-ref.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// RUN: %clangxx -I %sycl_include -fsyntax-only -Xclang -verify %s
// expected-no-diagnostics
//
//==-- sub-group-store-const-ref.cpp ---------------------------------------==//
//
// 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
//
//===----------------------------------------------------------------------===//
// This test checks that sub_group::store supports const reference.
//===----------------------------------------------------------------------===//
#include <CL/sycl.hpp>
using namespace sycl;

void test(intel::sub_group sg, global_ptr<int> ptr) { sg.store(ptr, 1); }