Skip to content

Commit

Permalink
[oneDPL] Fix double dereference in the function `__work_group_reduce_…
Browse files Browse the repository at this point in the history
…kernel` (oneapi-src#1751)
  • Loading branch information
SergeyKopienko authored Aug 2, 2024
1 parent 8533409 commit 699dec1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ template <typename _Tp, typename _NDItemId, typename _Size, typename _TransformP
void
__work_group_reduce_kernel(const _NDItemId __item_id, const _Size __n, const _Size __iters_per_work_item,
const bool __is_full, _TransformPattern __transform_pattern, _ReducePattern __reduce_pattern,
_InitType __init, const _AccLocal& __local_mem, const _Res& __res_acc, const _Acc&... __acc)
_InitType __init, const _AccLocal& __local_mem, _Res* __res_ptr, const _Acc&... __acc)
{
auto __local_idx = __item_id.get_local_id(0);
const _Size __group_size = __item_id.get_local_range().size();
Expand All @@ -87,7 +87,7 @@ __work_group_reduce_kernel(const _NDItemId __item_id, const _Size __n, const _Si
if (__local_idx == 0)
{
__reduce_pattern.apply_init(__init, __result.__v);
__res_acc[0] = __result.__v;
__res_ptr[0] = __result.__v;
}
__result.__v.~_Tp();
}
Expand Down

0 comments on commit 699dec1

Please sign in to comment.