Skip to content

Commit c16775d

Browse files
[SYCL] Do not use handler::addAccessorReq() (#16111)
This function might be useful only when an accessor is connected with different CG that was used during a construction of the accessor. Currently it’s helpful only in single case of reduction, and in this case the accessor can be connected to a right CG in the constructor. Modify the use case and remove all calls to addAccessorReq().
1 parent cc75bdd commit c16775d

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,6 @@ class __SYCL_EXPORT handler {
609609
detail::AccessorBaseHost *AccBase = (detail::AccessorBaseHost *)&Arg;
610610
detail::AccessorImplPtr AccImpl = detail::getSyclObjImpl(*AccBase);
611611
detail::AccessorImplHost *Req = AccImpl.get();
612-
addAccessorReq(std::move(AccImpl));
613612
// Add accessor to the list of arguments.
614613
addArg(detail::kernel_param_kind_t::kind_accessor, Req,
615614
static_cast<int>(AccessTarget), ArgIndex);
@@ -2549,9 +2548,6 @@ class __SYCL_EXPORT handler {
25492548

25502549
MSrcPtr = static_cast<void *>(AccImpl.get());
25512550
MDstPtr = static_cast<void *>(Dst);
2552-
// Store copy of accessor to the local storage to make sure it is alive
2553-
// until we finish
2554-
addAccessorReq(std::move(AccImpl));
25552551
}
25562552

25572553
/// Copies the content of memory pointed by Src into the memory object
@@ -2587,9 +2583,6 @@ class __SYCL_EXPORT handler {
25872583

25882584
MSrcPtr = const_cast<T_Src *>(Src);
25892585
MDstPtr = static_cast<void *>(AccImpl.get());
2590-
// Store copy of accessor to the local storage to make sure it is alive
2591-
// until we finish
2592-
addAccessorReq(std::move(AccImpl));
25932586
}
25942587

25952588
/// Copies the content of memory object accessed by Src to the memory
@@ -2644,10 +2637,6 @@ class __SYCL_EXPORT handler {
26442637

26452638
MSrcPtr = AccImplSrc.get();
26462639
MDstPtr = AccImplDst.get();
2647-
// Store copy of accessor to the local storage to make sure it is alive
2648-
// until we finish
2649-
addAccessorReq(std::move(AccImplSrc));
2650-
addAccessorReq(std::move(AccImplDst));
26512640
}
26522641

26532642
/// Provides guarantees that the memory object accessed via Acc is updated
@@ -2673,7 +2662,6 @@ class __SYCL_EXPORT handler {
26732662
detail::AccessorImplPtr AccImpl = detail::getSyclObjImpl(*AccBase);
26742663

26752664
MDstPtr = static_cast<void *>(AccImpl.get());
2676-
addAccessorReq(std::move(AccImpl));
26772665
}
26782666

26792667
public:
@@ -3429,7 +3417,6 @@ class __SYCL_EXPORT handler {
34293417
detail::AccessorImplPtr AccImpl = detail::getSyclObjImpl(*AccBase);
34303418

34313419
MDstPtr = static_cast<void *>(AccImpl.get());
3432-
addAccessorReq(std::move(AccImpl));
34333420

34343421
MPattern.resize(sizeof(T));
34353422
auto PatternPtr = reinterpret_cast<T *>(MPattern.data());

sycl/include/sycl/reduction.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ class reduction_impl_algo {
10141014
}
10151015
});
10161016
} else {
1017-
accessor OutAcc{Out, CGH};
1017+
accessor OutAcc{Out, CopyHandler};
10181018
CopyHandler.copy(Mem, OutAcc);
10191019
}
10201020
});

sycl/source/handler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,12 +2052,16 @@ void handler::SetHostTask(std::function<void(interop_handle)> &&Func) {
20522052
setType(detail::CGType::CodeplayHostTask);
20532053
}
20542054

2055+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
2056+
// TODO: This function is not used anymore, remove it in the next
2057+
// ABI-breaking window.
20552058
void handler::addAccessorReq(detail::AccessorImplPtr Accessor) {
20562059
// Add accessor to the list of requirements.
20572060
impl->CGData.MRequirements.push_back(Accessor.get());
20582061
// Store copy of the accessor.
20592062
impl->CGData.MAccStorage.push_back(std::move(Accessor));
20602063
}
2064+
#endif
20612065

20622066
void handler::addLifetimeSharedPtrStorage(std::shared_ptr<const void> SPtr) {
20632067
impl->CGData.MSharedPtrStorage.push_back(std::move(SPtr));

0 commit comments

Comments
 (0)