@@ -199,7 +199,7 @@ fill_image_desc(const ext::oneapi::experimental::image_descriptor &ImgDesc) {
199
199
}
200
200
201
201
static void
202
- fill_copy_args (std::shared_ptr< detail::handler_impl> & impl,
202
+ fill_copy_args (detail::handler_impl * impl,
203
203
const ext::oneapi::experimental::image_descriptor &SrcImgDesc,
204
204
const ext::oneapi::experimental::image_descriptor &DestImgDesc,
205
205
ur_exp_image_copy_flags_t ImageCopyFlags, size_t SrcPitch,
@@ -266,7 +266,7 @@ fill_copy_args(std::shared_ptr<detail::handler_impl> &impl,
266
266
}
267
267
268
268
static void
269
- fill_copy_args (std::shared_ptr< detail::handler_impl> & impl,
269
+ fill_copy_args (detail::handler_impl * impl,
270
270
const ext::oneapi::experimental::image_descriptor &Desc,
271
271
ur_exp_image_copy_flags_t ImageCopyFlags,
272
272
sycl::range<3 > SrcOffset = {0 , 0 , 0 },
@@ -281,7 +281,7 @@ fill_copy_args(std::shared_ptr<detail::handler_impl> &impl,
281
281
}
282
282
283
283
static void
284
- fill_copy_args (std::shared_ptr< detail::handler_impl> & impl,
284
+ fill_copy_args (detail::handler_impl * impl,
285
285
const ext::oneapi::experimental::image_descriptor &Desc,
286
286
ur_exp_image_copy_flags_t ImageCopyFlags, size_t SrcPitch,
287
287
size_t DestPitch, sycl::range<3 > SrcOffset = {0 , 0 , 0 },
@@ -295,7 +295,7 @@ fill_copy_args(std::shared_ptr<detail::handler_impl> &impl,
295
295
}
296
296
297
297
static void
298
- fill_copy_args (std::shared_ptr< detail::handler_impl> & impl,
298
+ fill_copy_args (detail::handler_impl * impl,
299
299
const ext::oneapi::experimental::image_descriptor &SrcImgDesc,
300
300
const ext::oneapi::experimental::image_descriptor &DestImgDesc,
301
301
ur_exp_image_copy_flags_t ImageCopyFlags,
@@ -314,20 +314,32 @@ fill_copy_args(std::shared_ptr<detail::handler_impl> &impl,
314
314
315
315
handler::handler (std::shared_ptr<detail::queue_impl> Queue,
316
316
bool CallerNeedsEvent)
317
- : handler(Queue, Queue, nullptr , CallerNeedsEvent) {}
317
+ : impl(std::make_shared<detail::handler_impl>(Queue.get(), nullptr ,
318
+ CallerNeedsEvent)),
319
+ MQueue (Queue) {}
318
320
321
+ #ifndef __INTEL_PREVIEW_BREAKING_CHANGES
322
+ // TODO: This function is not used anymore, remove it in the next
323
+ // ABI-breaking window.
319
324
handler::handler (std::shared_ptr<detail::queue_impl> Queue,
320
325
std::shared_ptr<detail::queue_impl> PrimaryQueue,
321
326
std::shared_ptr<detail::queue_impl> SecondaryQueue,
322
327
bool CallerNeedsEvent)
323
- : impl(std::make_shared<detail::handler_impl>(std::move(PrimaryQueue),
324
- std::move (SecondaryQueue),
328
+ : impl(std::make_shared<detail::handler_impl>(
329
+ PrimaryQueue.get(), SecondaryQueue.get(), CallerNeedsEvent)),
330
+ MQueue(Queue) {}
331
+ #endif
332
+
333
+ handler::handler (std::shared_ptr<detail::queue_impl> Queue,
334
+ detail::queue_impl *PrimaryQueue,
335
+ detail::queue_impl *SecondaryQueue, bool CallerNeedsEvent)
336
+ : impl(std::make_shared<detail::handler_impl>(PrimaryQueue, SecondaryQueue,
325
337
CallerNeedsEvent)),
326
338
MQueue(std::move(Queue)) {}
327
339
328
340
handler::handler (
329
341
std::shared_ptr<ext::oneapi::experimental::detail::graph_impl> Graph)
330
- : impl(std::make_shared<detail::handler_impl>(std::move( Graph) )) {}
342
+ : impl(std::make_shared<detail::handler_impl>(Graph)) {}
331
343
332
344
// Sets the submission state to indicate that an explicit kernel bundle has been
333
345
// set. Throws a sycl::exception with errc::invalid if the current state
@@ -1339,7 +1351,7 @@ void handler::ext_oneapi_copy(
1339
1351
MSrcPtr = const_cast <void *>(Src);
1340
1352
MDstPtr = reinterpret_cast <void *>(Dest.raw_handle );
1341
1353
1342
- detail::fill_copy_args (impl, DestImgDesc,
1354
+ detail::fill_copy_args (impl. get () , DestImgDesc,
1343
1355
UR_EXP_IMAGE_COPY_FLAG_HOST_TO_DEVICE);
1344
1356
1345
1357
setType (detail::CGType::CopyImage);
@@ -1357,7 +1369,7 @@ void handler::ext_oneapi_copy(
1357
1369
MSrcPtr = const_cast <void *>(Src);
1358
1370
MDstPtr = reinterpret_cast <void *>(Dest.raw_handle );
1359
1371
1360
- detail::fill_copy_args (impl, DestImgDesc,
1372
+ detail::fill_copy_args (impl. get () , DestImgDesc,
1361
1373
UR_EXP_IMAGE_COPY_FLAG_HOST_TO_DEVICE, SrcOffset,
1362
1374
SrcExtent, DestOffset, {0 , 0 , 0 }, CopyExtent);
1363
1375
@@ -1374,7 +1386,7 @@ void handler::ext_oneapi_copy(
1374
1386
MSrcPtr = reinterpret_cast <void *>(Src.raw_handle );
1375
1387
MDstPtr = Dest;
1376
1388
1377
- detail::fill_copy_args (impl, SrcImgDesc,
1389
+ detail::fill_copy_args (impl. get () , SrcImgDesc,
1378
1390
UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_HOST);
1379
1391
1380
1392
setType (detail::CGType::CopyImage);
@@ -1393,7 +1405,7 @@ void handler::ext_oneapi_copy(
1393
1405
MSrcPtr = reinterpret_cast <void *>(Src.raw_handle );
1394
1406
MDstPtr = Dest;
1395
1407
1396
- detail::fill_copy_args (impl, SrcImgDesc,
1408
+ detail::fill_copy_args (impl. get () , SrcImgDesc,
1397
1409
UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_HOST, SrcOffset,
1398
1410
{0 , 0 , 0 }, DestOffset, DestExtent, CopyExtent);
1399
1411
@@ -1417,7 +1429,7 @@ void handler::ext_oneapi_copy(
1417
1429
1418
1430
if (ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_HOST_TO_DEVICE ||
1419
1431
ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_HOST) {
1420
- detail::fill_copy_args (impl, Desc, ImageCopyFlags, DeviceRowPitch,
1432
+ detail::fill_copy_args (impl. get () , Desc, ImageCopyFlags, DeviceRowPitch,
1421
1433
DeviceRowPitch);
1422
1434
} else {
1423
1435
throw sycl::exception (make_error_code (errc::invalid),
@@ -1447,13 +1459,13 @@ void handler::ext_oneapi_copy(
1447
1459
1448
1460
// Fill the host extent based on the type of copy.
1449
1461
if (ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_HOST_TO_DEVICE) {
1450
- detail::fill_copy_args (impl, DeviceImgDesc, ImageCopyFlags, DeviceRowPitch ,
1451
- DeviceRowPitch, SrcOffset, HostExtent, DestOffset ,
1452
- {0 , 0 , 0 }, CopyExtent);
1462
+ detail::fill_copy_args (impl. get () , DeviceImgDesc, ImageCopyFlags,
1463
+ DeviceRowPitch, DeviceRowPitch, SrcOffset ,
1464
+ HostExtent, DestOffset, {0 , 0 , 0 }, CopyExtent);
1453
1465
} else if (ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_HOST) {
1454
- detail::fill_copy_args (impl, DeviceImgDesc, ImageCopyFlags, DeviceRowPitch ,
1455
- DeviceRowPitch, SrcOffset, {0 , 0 , 0 }, DestOffset ,
1456
- HostExtent, CopyExtent);
1466
+ detail::fill_copy_args (impl. get () , DeviceImgDesc, ImageCopyFlags,
1467
+ DeviceRowPitch, DeviceRowPitch, SrcOffset, {0 , 0 , 0 },
1468
+ DestOffset, HostExtent, CopyExtent);
1457
1469
} else {
1458
1470
throw sycl::exception (make_error_code (errc::invalid),
1459
1471
" Copy Error: This copy function only performs host "
@@ -1475,7 +1487,7 @@ void handler::ext_oneapi_copy(
1475
1487
MSrcPtr = reinterpret_cast <void *>(Src.raw_handle );
1476
1488
MDstPtr = reinterpret_cast <void *>(Dest.raw_handle );
1477
1489
1478
- detail::fill_copy_args (impl, SrcImgDesc, DestImgDesc,
1490
+ detail::fill_copy_args (impl. get () , SrcImgDesc, DestImgDesc,
1479
1491
UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE);
1480
1492
1481
1493
setType (detail::CGType::CopyImage);
@@ -1495,7 +1507,7 @@ void handler::ext_oneapi_copy(
1495
1507
MSrcPtr = reinterpret_cast <void *>(Src.raw_handle );
1496
1508
MDstPtr = reinterpret_cast <void *>(Dest.raw_handle );
1497
1509
1498
- detail::fill_copy_args (impl, SrcImgDesc, DestImgDesc,
1510
+ detail::fill_copy_args (impl. get () , SrcImgDesc, DestImgDesc,
1499
1511
UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE, SrcOffset,
1500
1512
{0 , 0 , 0 }, DestOffset, {0 , 0 , 0 }, CopyExtent);
1501
1513
@@ -1514,7 +1526,7 @@ void handler::ext_oneapi_copy(
1514
1526
MSrcPtr = reinterpret_cast <void *>(Src.raw_handle );
1515
1527
MDstPtr = Dest;
1516
1528
1517
- detail::fill_copy_args (impl, SrcImgDesc, DestImgDesc,
1529
+ detail::fill_copy_args (impl. get () , SrcImgDesc, DestImgDesc,
1518
1530
UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE, 0 ,
1519
1531
DestRowPitch);
1520
1532
@@ -1535,9 +1547,10 @@ void handler::ext_oneapi_copy(
1535
1547
MSrcPtr = reinterpret_cast <void *>(Src.raw_handle );
1536
1548
MDstPtr = Dest;
1537
1549
1538
- detail::fill_copy_args (
1539
- impl, SrcImgDesc, DestImgDesc, UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE, 0 ,
1540
- DestRowPitch, SrcOffset, {0 , 0 , 0 }, DestOffset, {0 , 0 , 0 }, CopyExtent);
1550
+ detail::fill_copy_args (impl.get (), SrcImgDesc, DestImgDesc,
1551
+ UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE, 0 ,
1552
+ DestRowPitch, SrcOffset, {0 , 0 , 0 }, DestOffset,
1553
+ {0 , 0 , 0 }, CopyExtent);
1541
1554
1542
1555
setType (detail::CGType::CopyImage);
1543
1556
}
@@ -1554,7 +1567,7 @@ void handler::ext_oneapi_copy(
1554
1567
MSrcPtr = const_cast <void *>(Src);
1555
1568
MDstPtr = reinterpret_cast <void *>(Dest.raw_handle );
1556
1569
1557
- detail::fill_copy_args (impl, SrcImgDesc, DestImgDesc,
1570
+ detail::fill_copy_args (impl. get () , SrcImgDesc, DestImgDesc,
1558
1571
UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE, SrcRowPitch,
1559
1572
0 );
1560
1573
@@ -1575,9 +1588,10 @@ void handler::ext_oneapi_copy(
1575
1588
MSrcPtr = const_cast <void *>(Src);
1576
1589
MDstPtr = reinterpret_cast <void *>(Dest.raw_handle );
1577
1590
1578
- detail::fill_copy_args (
1579
- impl, SrcImgDesc, DestImgDesc, UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE,
1580
- SrcRowPitch, 0 , SrcOffset, {0 , 0 , 0 }, DestOffset, {0 , 0 , 0 }, CopyExtent);
1591
+ detail::fill_copy_args (impl.get (), SrcImgDesc, DestImgDesc,
1592
+ UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE, SrcRowPitch,
1593
+ 0 , SrcOffset, {0 , 0 , 0 }, DestOffset, {0 , 0 , 0 },
1594
+ CopyExtent);
1581
1595
1582
1596
setType (detail::CGType::CopyImage);
1583
1597
}
@@ -1601,7 +1615,7 @@ void handler::ext_oneapi_copy(
1601
1615
1602
1616
if (ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE ||
1603
1617
ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_HOST_TO_HOST) {
1604
- detail::fill_copy_args (impl, SrcImgDesc, DestImgDesc, ImageCopyFlags,
1618
+ detail::fill_copy_args (impl. get () , SrcImgDesc, DestImgDesc, ImageCopyFlags,
1605
1619
SrcRowPitch, DestRowPitch);
1606
1620
} else {
1607
1621
throw sycl::exception (make_error_code (errc::invalid),
@@ -1628,7 +1642,7 @@ void handler::ext_oneapi_copy(
1628
1642
1629
1643
if (ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE ||
1630
1644
ImageCopyFlags == UR_EXP_IMAGE_COPY_FLAG_HOST_TO_HOST) {
1631
- detail::fill_copy_args (impl, SrcImgDesc, DestImgDesc, ImageCopyFlags,
1645
+ detail::fill_copy_args (impl. get () , SrcImgDesc, DestImgDesc, ImageCopyFlags,
1632
1646
SrcRowPitch, DestRowPitch, SrcOffset, {0 , 0 , 0 },
1633
1647
DestOffset, {0 , 0 , 0 }, CopyExtent);
1634
1648
} else {
@@ -1752,21 +1766,18 @@ void handler::ext_oneapi_signal_external_semaphore(
1752
1766
1753
1767
void handler::use_kernel_bundle (
1754
1768
const kernel_bundle<bundle_state::executable> &ExecBundle) {
1755
- std::shared_ptr<detail::queue_impl> PrimaryQueue =
1756
- impl->MSubmissionPrimaryQueue ;
1757
- if ((!impl->MGraph &&
1758
- (PrimaryQueue->get_context () != ExecBundle.get_context ())) ||
1769
+ if ((!impl->MGraph && (impl->MSubmissionPrimaryQueue ->get_context () !=
1770
+ ExecBundle.get_context ())) ||
1759
1771
(impl->MGraph &&
1760
1772
(impl->MGraph ->getContext () != ExecBundle.get_context ())))
1761
1773
throw sycl::exception (
1762
1774
make_error_code (errc::invalid),
1763
1775
" Context associated with the primary queue is different from the "
1764
1776
" context associated with the kernel bundle" );
1765
1777
1766
- std::shared_ptr<detail::queue_impl> SecondaryQueue =
1767
- impl->MSubmissionSecondaryQueue ;
1768
- if (SecondaryQueue &&
1769
- SecondaryQueue->get_context () != ExecBundle.get_context ())
1778
+ if (impl->MSubmissionSecondaryQueue &&
1779
+ impl->MSubmissionSecondaryQueue ->get_context () !=
1780
+ ExecBundle.get_context ())
1770
1781
throw sycl::exception (
1771
1782
make_error_code (errc::invalid),
1772
1783
" Context associated with the secondary queue is different from the "
@@ -1917,7 +1928,7 @@ void handler::verifyDeviceHasProgressGuarantee(
1917
1928
}
1918
1929
1919
1930
bool handler::supportsUSMMemcpy2D () {
1920
- for (const std::shared_ptr< detail::queue_impl> & QueueImpl :
1931
+ for (detail::queue_impl * QueueImpl :
1921
1932
{impl->MSubmissionPrimaryQueue , impl->MSubmissionSecondaryQueue }) {
1922
1933
if (QueueImpl &&
1923
1934
!checkContextSupports (QueueImpl->getContextImplPtr (),
@@ -1928,7 +1939,7 @@ bool handler::supportsUSMMemcpy2D() {
1928
1939
}
1929
1940
1930
1941
bool handler::supportsUSMFill2D () {
1931
- for (const std::shared_ptr< detail::queue_impl> & QueueImpl :
1942
+ for (detail::queue_impl * QueueImpl :
1932
1943
{impl->MSubmissionPrimaryQueue , impl->MSubmissionSecondaryQueue }) {
1933
1944
if (QueueImpl && !checkContextSupports (QueueImpl->getContextImplPtr (),
1934
1945
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT))
@@ -1938,7 +1949,7 @@ bool handler::supportsUSMFill2D() {
1938
1949
}
1939
1950
1940
1951
bool handler::supportsUSMMemset2D () {
1941
- for (const std::shared_ptr< detail::queue_impl> & QueueImpl :
1952
+ for (detail::queue_impl * QueueImpl :
1942
1953
{impl->MSubmissionPrimaryQueue , impl->MSubmissionSecondaryQueue }) {
1943
1954
if (QueueImpl && !checkContextSupports (QueueImpl->getContextImplPtr (),
1944
1955
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT))
0 commit comments