@@ -314,28 +314,26 @@ fill_copy_args(detail::handler_impl *impl,
314
314
315
315
handler::handler (std::shared_ptr<detail::queue_impl> Queue,
316
316
bool CallerNeedsEvent)
317
- : impl(std::make_shared<detail::handler_impl>(Queue.get(),
317
+ : impl(std::make_shared<detail::handler_impl>(Queue.get(), nullptr ,
318
318
CallerNeedsEvent)),
319
319
MQueue (std::move(Queue)) {}
320
320
321
321
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
322
322
// TODO: This function is not used anymore, remove it in the next
323
323
// ABI-breaking window.
324
- handler::handler (
325
- std::shared_ptr<detail::queue_impl> Queue,
326
- std::shared_ptr<detail::queue_impl> PrimaryQueue,
327
- [[maybe_unused]] std::shared_ptr<detail::queue_impl> SecondaryQueue,
328
- bool CallerNeedsEvent)
329
- : impl(std::make_shared<detail::handler_impl>(PrimaryQueue.get(),
330
- CallerNeedsEvent)),
324
+ handler::handler (std::shared_ptr<detail::queue_impl> Queue,
325
+ std::shared_ptr<detail::queue_impl> PrimaryQueue,
326
+ std::shared_ptr<detail::queue_impl> SecondaryQueue,
327
+ bool CallerNeedsEvent)
328
+ : impl(std::make_shared<detail::handler_impl>(
329
+ PrimaryQueue.get(), SecondaryQueue.get(), CallerNeedsEvent)),
331
330
MQueue(Queue) {}
332
331
#endif
333
332
334
333
handler::handler (std::shared_ptr<detail::queue_impl> Queue,
335
334
detail::queue_impl *PrimaryQueue,
336
- [[maybe_unused]] detail::queue_impl *SecondaryQueue,
337
- bool CallerNeedsEvent)
338
- : impl(std::make_shared<detail::handler_impl>(PrimaryQueue,
335
+ detail::queue_impl *SecondaryQueue, bool CallerNeedsEvent)
336
+ : impl(std::make_shared<detail::handler_impl>(PrimaryQueue, SecondaryQueue,
339
337
CallerNeedsEvent)),
340
338
MQueue(std::move(Queue)) {}
341
339
@@ -1777,6 +1775,14 @@ void handler::use_kernel_bundle(
1777
1775
" Context associated with the primary queue is different from the "
1778
1776
" context associated with the kernel bundle" );
1779
1777
1778
+ if (impl->MSubmissionSecondaryQueue &&
1779
+ impl->MSubmissionSecondaryQueue ->get_context () !=
1780
+ ExecBundle.get_context ())
1781
+ throw sycl::exception (
1782
+ make_error_code (errc::invalid),
1783
+ " Context associated with the secondary queue is different from the "
1784
+ " context associated with the kernel bundle" );
1785
+
1780
1786
setStateExplicitKernelBundle ();
1781
1787
setHandlerKernelBundle (detail::getSyclObjImpl (ExecBundle));
1782
1788
}
@@ -1922,28 +1928,34 @@ void handler::verifyDeviceHasProgressGuarantee(
1922
1928
}
1923
1929
1924
1930
bool handler::supportsUSMMemcpy2D () {
1925
- auto &PrimQueue = impl->MSubmissionPrimaryQueue ;
1926
- if (PrimQueue)
1927
- return checkContextSupports (PrimQueue->getContextImplPtr (),
1928
- UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT);
1929
- else
1930
- // Return true when handler_impl is constructed with a graph.
1931
- return true ;
1931
+ for (detail::queue_impl *QueueImpl :
1932
+ {impl->MSubmissionPrimaryQueue , impl->MSubmissionSecondaryQueue }) {
1933
+ if (QueueImpl &&
1934
+ !checkContextSupports (QueueImpl->getContextImplPtr (),
1935
+ UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT))
1936
+ return false ;
1937
+ }
1938
+ return true ;
1932
1939
}
1933
1940
1934
1941
bool handler::supportsUSMFill2D () {
1935
- auto &PrimQueue = impl-> MSubmissionPrimaryQueue ;
1936
- if (PrimQueue)
1937
- return checkContextSupports (PrimQueue ->getContextImplPtr (),
1938
- UR_CONTEXT_INFO_USM_FILL2D_SUPPORT);
1939
- else
1940
- // Return true when handler_impl is constructed with a graph.
1941
- return true ;
1942
+ for (detail::queue_impl *QueueImpl :
1943
+ {impl-> MSubmissionPrimaryQueue , impl-> MSubmissionSecondaryQueue }) {
1944
+ if (QueueImpl && ! checkContextSupports (QueueImpl ->getContextImplPtr (),
1945
+ UR_CONTEXT_INFO_USM_FILL2D_SUPPORT))
1946
+ return false ;
1947
+ }
1948
+ return true ;
1942
1949
}
1943
1950
1944
1951
bool handler::supportsUSMMemset2D () {
1945
- // memset use the same UR check as fill2D.
1946
- return supportsUSMFill2D ();
1952
+ for (detail::queue_impl *QueueImpl :
1953
+ {impl->MSubmissionPrimaryQueue , impl->MSubmissionSecondaryQueue }) {
1954
+ if (QueueImpl && !checkContextSupports (QueueImpl->getContextImplPtr (),
1955
+ UR_CONTEXT_INFO_USM_FILL2D_SUPPORT))
1956
+ return false ;
1957
+ }
1958
+ return true ;
1947
1959
}
1948
1960
1949
1961
id<2 > handler::computeFallbackKernelBounds (size_t Width, size_t Height) {
0 commit comments