@@ -118,11 +118,6 @@ event queue_impl::memset(const std::shared_ptr<detail::queue_impl> &Self,
118
118
// Emit a begin/end scope for this call
119
119
PrepareNotify.scopedNotify ((uint16_t )xpti::trace_point_type_t ::task_begin);
120
120
#endif
121
- if (MGraph.lock ()) {
122
- throw sycl::exception (make_error_code (errc::invalid),
123
- " The memset feature is not yet available "
124
- " for use with the SYCL Graph extension." );
125
- }
126
121
127
122
return submitMemOpHelper (
128
123
Self, DepEvents, [&](handler &CGH) { CGH.memset (Ptr, Value, Count); },
@@ -169,19 +164,14 @@ event queue_impl::memcpy(const std::shared_ptr<detail::queue_impl> &Self,
169
164
// Emit a begin/end scope for this call
170
165
PrepareNotify.scopedNotify ((uint16_t )xpti::trace_point_type_t ::task_begin);
171
166
#endif
172
- // If we have a command graph set we need to capture the copy through normal
173
- // queue submission rather than execute the copy directly.
174
- auto HandlerFunc = [&](handler &CGH) { CGH.memcpy (Dest, Src, Count); };
175
- if (MGraph.lock ())
176
- return submitWithHandler (Self, DepEvents, HandlerFunc);
177
167
178
168
if ((!Src || !Dest) && Count != 0 ) {
179
169
report (CodeLoc);
180
170
throw runtime_error (" NULL pointer argument in memory copy operation." ,
181
171
PI_ERROR_INVALID_VALUE);
182
172
}
183
173
return submitMemOpHelper (
184
- Self, DepEvents, HandlerFunc ,
174
+ Self, DepEvents, [&](handler &CGH) { CGH. memcpy (Dest, Src, Count); } ,
185
175
[](const auto &...Args ) { MemoryManager::copy_usm (Args...); }, Src, Self,
186
176
Count, Dest);
187
177
}
@@ -190,14 +180,9 @@ event queue_impl::mem_advise(const std::shared_ptr<detail::queue_impl> &Self,
190
180
const void *Ptr, size_t Length,
191
181
pi_mem_advice Advice,
192
182
const std::vector<event> &DepEvents) {
193
- // If we have a command graph set we need to capture the advise through normal
194
- // queue submission.
195
- auto HandlerFunc = [&](handler &CGH) { CGH.mem_advise (Ptr, Length, Advice); };
196
- if (MGraph.lock ())
197
- return submitWithHandler (Self, DepEvents, HandlerFunc);
198
-
199
183
return submitMemOpHelper (
200
- Self, DepEvents, HandlerFunc,
184
+ Self, DepEvents,
185
+ [&](handler &CGH) { CGH.mem_advise (Ptr, Length, Advice); },
201
186
[](const auto &...Args ) { MemoryManager::advise_usm (Args...); }, Ptr,
202
187
Self, Length, Advice);
203
188
}
@@ -353,7 +338,10 @@ event queue_impl::submitMemOpHelper(const std::shared_ptr<queue_impl> &Self,
353
338
const std::vector<event> &ExpandedDepEvents =
354
339
getExtendDependencyList (DepEvents, MutableDepEvents, Lock);
355
340
356
- if (areEventsSafeForSchedulerBypass (ExpandedDepEvents, MContext)) {
341
+ // If we have a command graph set we need to capture the op through the
342
+ // handler rather than by-passing the scheduler.
343
+ if (!MGraph.lock () &&
344
+ areEventsSafeForSchedulerBypass (ExpandedDepEvents, MContext)) {
357
345
if (MSupportsDiscardingPiEvents) {
358
346
MemOpFunc (MemOpArgs..., getPIEvents (ExpandedDepEvents),
359
347
/* PiEvent*/ nullptr , /* EventImplPtr*/ nullptr );
0 commit comments