Skip to content

Commit ac207a1

Browse files
[SYCL] Fix return type of initialization value extraction (#16224)
This commit fixes an issue where the function extracting the initial value of a device_global would return it as a reference to a different type, which in turn could cause some unexpected behavior. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
1 parent a8e8b4e commit ac207a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/include/sycl/ext/oneapi/device_global/device_global.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class device_global_base {
8383

8484
#ifndef __SYCL_DEVICE_ONLY__
8585
template <typename OtherT, typename OtherProps>
86-
static constexpr const T &
86+
static constexpr const OtherT &
8787
ExtractInitialVal(const device_global_base<OtherT, OtherProps> &Other) {
8888
if constexpr (OtherProps::template has_property<device_image_scope_key>())
8989
return Other.val;

0 commit comments

Comments
 (0)