From d314612ebd925cd2e931c54aa7f982c70fd3f9ff Mon Sep 17 00:00:00 2001 From: "Sidorov, Dmitry" Date: Thu, 27 Mar 2025 03:19:56 -0700 Subject: [PATCH] [NFCI][SYCL] Make get_group_id to return by reference It will enforce address space to the return value helping to avoid invalid AS cast from local to private for sret argument that would appear after https://github.com/llvm/llvm-project/pull/128166 and the related work. Signed-off-by: Sidorov, Dmitry --- sycl/include/sycl/group.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/group.hpp b/sycl/include/sycl/group.hpp index 50b5fe6e586ad..0be63b292ce37 100644 --- a/sycl/include/sycl/group.hpp +++ b/sycl/include/sycl/group.hpp @@ -120,7 +120,7 @@ template class __SYCL_TYPE(group) group { __SYCL2020_DEPRECATED("use sycl::group::get_group_id() instead") size_t get_id(int dimension) const { return index[dimension]; } - id get_group_id() const { return index; } + id &get_group_id() { return index; } size_t get_group_id(int dimension) const { return index[dimension]; }