@@ -170,8 +170,8 @@ class kernel_impl {
170
170
// / \param WG // update description
171
171
// / \return depends on information being queried.
172
172
template <typename Param>
173
- typename Param::return_type
174
- ext_oneapi_get_info (queue Queue, const range<3 > &WG) const ;
173
+ typename Param::return_type ext_oneapi_get_info (queue Queue,
174
+ const range<3 > &WG) const ;
175
175
176
176
// / Query queue/launch-specific information from a kernel using the
177
177
// / info::kernel_queue_specific descriptor for a specific Queue and values.
@@ -181,8 +181,8 @@ class kernel_impl {
181
181
// / \param WG // update description
182
182
// / \return depends on information being queried.
183
183
template <typename Param>
184
- typename Param::return_type
185
- ext_oneapi_get_info (queue Queue, const range<2 > &WG) const ;
184
+ typename Param::return_type ext_oneapi_get_info (queue Queue,
185
+ const range<2 > &WG) const ;
186
186
187
187
// / Query queue/launch-specific information from a kernel using the
188
188
// / info::kernel_queue_specific descriptor for a specific Queue and values.
@@ -192,8 +192,8 @@ class kernel_impl {
192
192
// / \param WG // update description
193
193
// / \return depends on information being queried.
194
194
template <typename Param>
195
- typename Param::return_type
196
- ext_oneapi_get_info (queue Queue, const range<1 > &WG) const ;
195
+ typename Param::return_type ext_oneapi_get_info (queue Queue,
196
+ const range<1 > &WG) const ;
197
197
198
198
// / Get a constant reference to a raw kernel object.
199
199
// /
@@ -423,12 +423,13 @@ inline typename syclex::info::kernel_queue_specific::max_work_group_size::
423
423
syclex::info::kernel_queue_specific::max_work_group_size>(
424
424
queue Queue) const {
425
425
const auto &Adapter = getAdapter ();
426
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
426
+ const auto DeviceNativeHandle =
427
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
427
428
428
429
size_t KernelWGSize = 0 ;
429
430
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetGroupInfo>(
430
- MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_WORK_GROUP_SIZE, sizeof ( size_t ) ,
431
- &KernelWGSize, nullptr );
431
+ MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_WORK_GROUP_SIZE,
432
+ sizeof ( size_t ), &KernelWGSize, nullptr );
432
433
Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
433
434
// The feature is supported. Check for other errors and throw if any.
434
435
Adapter->checkUrResult (Result);
@@ -437,29 +438,27 @@ inline typename syclex::info::kernel_queue_specific::max_work_group_size::
437
438
return 0 ;
438
439
}
439
440
440
- template <int D>
441
- inline sycl::id<D> generate_id (const size_t * sizes)
442
- {
441
+ template <int D> inline sycl::id<D> generate_id (const size_t *sizes) {
443
442
sycl::id<D> ret;
444
- for (int i = 0 ; i < D; i++)
445
- {
443
+ for (int i = 0 ; i < D; i++) {
446
444
ret[i] = sizes[i];
447
445
}
448
446
return ret;
449
447
}
450
448
451
449
template <>
452
- inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<1 >::
453
- return_type
454
- kernel_impl::ext_oneapi_get_info<
455
- syclex::info::kernel_queue_specific::max_work_item_sizes<1 >>(
456
- queue Queue) const {
450
+ inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<
451
+ 1 >:: return_type
452
+ kernel_impl::ext_oneapi_get_info<
453
+ syclex::info::kernel_queue_specific::max_work_item_sizes<1 >>(
454
+ queue Queue) const {
457
455
const auto &Adapter = getAdapter ();
458
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
456
+ const auto DeviceNativeHandle =
457
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
459
458
size_t KernelWGSize[3 ] = {0 };
460
459
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetGroupInfo>(
461
- MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE,
462
- sizeof (size_t )* 3 , KernelWGSize, nullptr );
460
+ MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE,
461
+ sizeof (size_t ) * 3 , KernelWGSize, nullptr );
463
462
Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
464
463
// The feature is supported. Check for other errors and throw if any.
465
464
Adapter->checkUrResult (Result);
@@ -468,17 +467,18 @@ inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<1>::
468
467
}
469
468
470
469
template <>
471
- inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<2 >::
472
- return_type
473
- kernel_impl::ext_oneapi_get_info<
474
- syclex::info::kernel_queue_specific::max_work_item_sizes<2 >>(
475
- queue Queue) const {
470
+ inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<
471
+ 2 >:: return_type
472
+ kernel_impl::ext_oneapi_get_info<
473
+ syclex::info::kernel_queue_specific::max_work_item_sizes<2 >>(
474
+ queue Queue) const {
476
475
const auto &Adapter = getAdapter ();
477
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
476
+ const auto DeviceNativeHandle =
477
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
478
478
size_t KernelWGSize[3 ] = {0 };
479
479
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetGroupInfo>(
480
- MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE,
481
- sizeof (size_t )* 3 , KernelWGSize, nullptr );
480
+ MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE,
481
+ sizeof (size_t ) * 3 , KernelWGSize, nullptr );
482
482
Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
483
483
// The feature is supported. Check for other errors and throw if any.
484
484
Adapter->checkUrResult (Result);
@@ -487,17 +487,18 @@ inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<2>::
487
487
}
488
488
489
489
template <>
490
- inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<3 >::
491
- return_type
492
- kernel_impl::ext_oneapi_get_info<
493
- syclex::info::kernel_queue_specific::max_work_item_sizes<3 >>(
494
- queue Queue) const {
490
+ inline typename syclex::info::kernel_queue_specific::max_work_item_sizes<
491
+ 3 >:: return_type
492
+ kernel_impl::ext_oneapi_get_info<
493
+ syclex::info::kernel_queue_specific::max_work_item_sizes<3 >>(
494
+ queue Queue) const {
495
495
const auto &Adapter = getAdapter ();
496
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
496
+ const auto DeviceNativeHandle =
497
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
497
498
size_t KernelWGSize[3 ] = {0 };
498
499
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetGroupInfo>(
499
- MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE,
500
- sizeof (size_t )* 3 , KernelWGSize, nullptr );
500
+ MKernel, DeviceNativeHandle, UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE,
501
+ sizeof (size_t ) * 3 , KernelWGSize, nullptr );
501
502
Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
502
503
// The feature is supported. Check for other errors and throw if any.
503
504
Adapter->checkUrResult (Result);
@@ -516,13 +517,16 @@ inline typename syclex::info::kernel_queue_specific::max_sub_group_size::
516
517
throw exception (sycl::make_error_code (errc::invalid),
517
518
" The max work-group size cannot be zero." );
518
519
const auto &Adapter = getAdapter ();
519
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
520
+ const auto DeviceNativeHandle =
521
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
520
522
521
523
uint32_t KernelSubWGSize = 0 ;
522
524
523
525
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetSubGroupInfo>(
524
- MKernel, DeviceNativeHandle, UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, sizeof (uint32_t ), &KernelSubWGSize,
525
- nullptr );Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
526
+ MKernel, DeviceNativeHandle,
527
+ UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, sizeof (uint32_t ),
528
+ &KernelSubWGSize, nullptr );
529
+ Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
526
530
// The feature is supported. Check for other errors and throw if any.
527
531
Adapter->checkUrResult (Result);
528
532
return KernelSubWGSize;
@@ -541,13 +545,16 @@ inline typename syclex::info::kernel_queue_specific::max_sub_group_size::
541
545
throw exception (sycl::make_error_code (errc::invalid),
542
546
" The max work-group size cannot be zero." );
543
547
const auto &Adapter = getAdapter ();
544
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
548
+ const auto DeviceNativeHandle =
549
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
545
550
546
551
uint32_t KernelSubWGSize = 0 ;
547
552
548
553
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetSubGroupInfo>(
549
- MKernel, DeviceNativeHandle, UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, sizeof (uint32_t ), &KernelSubWGSize,
550
- nullptr );Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
554
+ MKernel, DeviceNativeHandle,
555
+ UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, sizeof (uint32_t ),
556
+ &KernelSubWGSize, nullptr );
557
+ Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
551
558
// The feature is supported. Check for other errors and throw if any.
552
559
Adapter->checkUrResult (Result);
553
560
return KernelSubWGSize;
@@ -565,13 +572,16 @@ inline typename syclex::info::kernel_queue_specific::max_sub_group_size::
565
572
throw exception (sycl::make_error_code (errc::invalid),
566
573
" The max work-group size cannot be zero." );
567
574
const auto &Adapter = getAdapter ();
568
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
575
+ const auto DeviceNativeHandle =
576
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
569
577
570
578
uint32_t KernelSubWGSize = 0 ;
571
579
572
580
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetSubGroupInfo>(
573
- MKernel, DeviceNativeHandle, UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, sizeof (uint32_t ), &KernelSubWGSize,
574
- nullptr );Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
581
+ MKernel, DeviceNativeHandle,
582
+ UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE, sizeof (uint32_t ),
583
+ &KernelSubWGSize, nullptr );
584
+ Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
575
585
// The feature is supported. Check for other errors and throw if any.
576
586
Adapter->checkUrResult (Result);
577
587
return KernelSubWGSize;
@@ -580,22 +590,24 @@ inline typename syclex::info::kernel_queue_specific::max_sub_group_size::
580
590
}
581
591
582
592
template <>
583
- inline typename syclex::info::kernel_queue_specific::num_sub_groups::
584
- return_type
585
- kernel_impl::ext_oneapi_get_info<
586
- syclex::info::kernel_queue_specific::num_sub_groups>(
587
- queue Queue, const range<3 > &WG) const {
593
+ inline typename syclex::info::kernel_queue_specific::num_sub_groups::return_type
594
+ kernel_impl::ext_oneapi_get_info<
595
+ syclex::info::kernel_queue_specific::num_sub_groups>(
596
+ queue Queue, const range<3 > &WG) const {
588
597
if (WG.size () == 0 )
589
598
throw exception (sycl::make_error_code (errc::invalid),
590
599
" The max work-group size cannot be zero." );
591
600
const auto &Adapter = getAdapter ();
592
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
601
+ const auto DeviceNativeHandle =
602
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
593
603
594
604
uint32_t KernelSubWGSize = 0 ;
595
605
596
606
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetSubGroupInfo>(
597
- MKernel, DeviceNativeHandle, UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, sizeof (uint32_t ), &KernelSubWGSize,
598
- nullptr );Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
607
+ MKernel, DeviceNativeHandle,
608
+ UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, sizeof (uint32_t ),
609
+ &KernelSubWGSize, nullptr );
610
+ Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
599
611
// The feature is supported. Check for other errors and throw if any.
600
612
Adapter->checkUrResult (Result);
601
613
return KernelSubWGSize;
@@ -604,22 +616,24 @@ inline typename syclex::info::kernel_queue_specific::num_sub_groups::
604
616
}
605
617
606
618
template <>
607
- inline typename syclex::info::kernel_queue_specific::num_sub_groups::
608
- return_type
609
- kernel_impl::ext_oneapi_get_info<
610
- syclex::info::kernel_queue_specific::num_sub_groups>(
611
- queue Queue, const range<2 > &WG) const {
619
+ inline typename syclex::info::kernel_queue_specific::num_sub_groups::return_type
620
+ kernel_impl::ext_oneapi_get_info<
621
+ syclex::info::kernel_queue_specific::num_sub_groups>(
622
+ queue Queue, const range<2 > &WG) const {
612
623
if (WG.size () == 0 )
613
624
throw exception (sycl::make_error_code (errc::invalid),
614
625
" The max work-group size cannot be zero." );
615
626
const auto &Adapter = getAdapter ();
616
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
627
+ const auto DeviceNativeHandle =
628
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
617
629
618
630
uint32_t KernelSubWGSize = 0 ;
619
631
620
632
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetSubGroupInfo>(
621
- MKernel, DeviceNativeHandle, UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, sizeof (uint32_t ), &KernelSubWGSize,
622
- nullptr );Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
633
+ MKernel, DeviceNativeHandle,
634
+ UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, sizeof (uint32_t ),
635
+ &KernelSubWGSize, nullptr );
636
+ Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
623
637
// The feature is supported. Check for other errors and throw if any.
624
638
Adapter->checkUrResult (Result);
625
639
return KernelSubWGSize;
@@ -628,22 +642,24 @@ inline typename syclex::info::kernel_queue_specific::num_sub_groups::
628
642
}
629
643
630
644
template <>
631
- inline typename syclex::info::kernel_queue_specific::num_sub_groups::
632
- return_type
633
- kernel_impl::ext_oneapi_get_info<
634
- syclex::info::kernel_queue_specific::num_sub_groups>(
635
- queue Queue, const range<1 > &WG) const {
645
+ inline typename syclex::info::kernel_queue_specific::num_sub_groups::return_type
646
+ kernel_impl::ext_oneapi_get_info<
647
+ syclex::info::kernel_queue_specific::num_sub_groups>(
648
+ queue Queue, const range<1 > &WG) const {
636
649
if (WG.size () == 0 )
637
650
throw exception (sycl::make_error_code (errc::invalid),
638
651
" The max work-group size cannot be zero." );
639
652
const auto &Adapter = getAdapter ();
640
- const auto DeviceNativeHandle = getSyclObjImpl (Queue.get_device ())->getHandleRef ();
653
+ const auto DeviceNativeHandle =
654
+ getSyclObjImpl (Queue.get_device ())->getHandleRef ();
641
655
642
656
uint32_t KernelSubWGSize = 0 ;
643
657
644
658
if (auto Result = Adapter->call_nocheck <UrApiKind::urKernelGetSubGroupInfo>(
645
- MKernel, DeviceNativeHandle, UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, sizeof (uint32_t ), &KernelSubWGSize,
646
- nullptr );Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
659
+ MKernel, DeviceNativeHandle,
660
+ UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS, sizeof (uint32_t ),
661
+ &KernelSubWGSize, nullptr );
662
+ Result != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
647
663
// The feature is supported. Check for other errors and throw if any.
648
664
Adapter->checkUrResult (Result);
649
665
return KernelSubWGSize;
0 commit comments