diff options
author | 2021-02-24 17:33:39 +0300 | |
---|---|---|
committer | 2021-02-24 17:33:39 +0300 | |
commit | c57d0da99faf2c37e3640a0253b9f3ce2c39e1ca (patch) | |
tree | a52a023c7ab02fa19e31ab67505d252abcb44a6b | |
parent | Version update (#132) (diff) | |
download | llvm-project-c57d0da99faf2c37e3640a0253b9f3ce2c39e1ca.tar.gz llvm-project-c57d0da99faf2c37e3640a0253b9f3ce2c39e1ca.tar.bz2 llvm-project-c57d0da99faf2c37e3640a0253b9f3ce2c39e1ca.zip |
Fix segmentation fault in the global scan functor (#139)
* Fix a check in the global scan functor
Signed-off-by: Pavlov, Evgeniy <evgeniy.pavlov@intel.com>
* Update include/oneapi/dpl/pstl/hetero/dpcpp/unseq_backend_sycl.h
Co-authored-by: Dmitriy Sobolev <Dmitriy.Sobolev@intel.com>
Co-authored-by: Andrey Fedorov <andrey.fedorov@intel.com>
Co-authored-by: Dmitriy Sobolev <Dmitriy.Sobolev@intel.com>
-rw-r--r-- | include/oneapi/dpl/pstl/hetero/dpcpp/unseq_backend_sycl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/unseq_backend_sycl.h b/include/oneapi/dpl/pstl/hetero/dpcpp/unseq_backend_sycl.h index 1e905359338e..fea351846027 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/unseq_backend_sycl.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/unseq_backend_sycl.h @@ -452,7 +452,7 @@ struct __global_scan_functor constexpr auto __shift = _Inclusive{} ? 0 : 1; auto __item_idx = __item.get_linear_id(); // skip the first group scanned locally - if (__item_idx >= __size_per_wg && __item_idx < __n) + if (__item_idx >= __size_per_wg && __item_idx + __shift < __n) { auto __wg_sums_idx = __item_idx / __size_per_wg - 1; // an initial value preceeds the first group for the exclusive scan |