@@ -445,15 +445,16 @@ bool testLocalAccSLM(queue Q, uint32_t Groups,
445
445
return Passed;
446
446
}
447
447
448
- template <typename T, bool TestPVCFeatures> bool test_block_store_usm (queue Q) {
448
+ template <typename T, TestFeatures Features>
449
+ bool test_block_store_usm (queue Q) {
449
450
constexpr bool CheckMask = true ;
450
451
constexpr bool CheckProperties = true ;
451
452
properties Align16Props{alignment<16 >};
452
453
properties AlignElemProps{alignment<sizeof (T)>};
453
454
454
455
bool Passed = true ;
455
456
456
- // Test block_store() that is available on Gen12 and PVC.
457
+ // Test block_store() that is available on Gen12, DG2 and PVC.
457
458
Passed &= testUSM<T, 1 , !CheckMask, CheckProperties>(Q, 2 , 4 , AlignElemProps);
458
459
Passed &= testUSM<T, 2 , !CheckMask, CheckProperties>(Q, 1 , 4 , AlignElemProps);
459
460
Passed &= testUSM<T, 3 , !CheckMask, CheckProperties>(Q, 2 , 8 , AlignElemProps);
@@ -482,60 +483,64 @@ template <typename T, bool TestPVCFeatures> bool test_block_store_usm(queue Q) {
482
483
Passed &= testUSM<T, 16 , !CheckMask, !CheckProperties>(Q, 2 , 4 , Align16Props);
483
484
Passed &= testUSM<T, 32 , !CheckMask, !CheckProperties>(Q, 2 , 4 , Align16Props);
484
485
485
- if constexpr (TestPVCFeatures) {
486
- // Using cache hints adds the requirement to run tests on PVC.
487
- // Also, PVC variant currently requires a) power-or-two elements,
486
+ if constexpr (Features == TestFeatures::PVC ||
487
+ Features == TestFeatures::DG2) {
488
+ // Using cache hints adds the requirement to run tests on DG2/PVC.
489
+ // Also, DG2/PVC variant currently requires a) power-or-two elements,
488
490
// b) the number of bytes stored per call must not exceed 512,
489
491
// c) the alignment of USM ptr + offset to be 4 or 8-bytes(for 8-byte
490
492
// element vectors).
491
493
constexpr size_t RequiredAlignment = sizeof (T) <= 4 ? 4 : 8 ;
492
- properties PVCProps {cache_hint_L1<cache_hint::write_back>,
493
- cache_hint_L2<cache_hint::write_back>,
494
- alignment<RequiredAlignment>};
494
+ properties DG2OrPVCProps {cache_hint_L1<cache_hint::write_back>,
495
+ cache_hint_L2<cache_hint::write_back>,
496
+ alignment<RequiredAlignment>};
495
497
// Only d/q-words are supported now.
496
498
// Thus we use this I32Factor for testing purposes and convenience.
497
499
constexpr int I32Factor =
498
500
std::max (static_cast <int >(sizeof (int ) / sizeof (T)), 1 );
499
501
500
- Passed &= testUSM<T, 1 * I32Factor, !CheckMask, CheckProperties>(Q, 2 , 4 ,
501
- PVCProps );
502
- Passed &= testUSM<T, 2 * I32Factor, !CheckMask, CheckProperties>(Q, 5 , 5 ,
503
- PVCProps );
504
- Passed &= testUSM<T, 4 * I32Factor, !CheckMask, CheckProperties>(Q, 5 , 5 ,
505
- PVCProps );
506
- Passed &= testUSM<T, 8 * I32Factor, !CheckMask, CheckProperties>(Q, 5 , 5 ,
507
- PVCProps );
508
- Passed &= testUSM<T, 16 * I32Factor, CheckMask, CheckProperties>(Q, 5 , 5 ,
509
- PVCProps );
510
- Passed &= testUSM<T, 32 * I32Factor, !CheckMask, CheckProperties>(Q, 2 , 4 ,
511
- PVCProps );
502
+ Passed &= testUSM<T, 1 * I32Factor, !CheckMask, CheckProperties>(
503
+ Q, 2 , 4 , DG2OrPVCProps );
504
+ Passed &= testUSM<T, 2 * I32Factor, !CheckMask, CheckProperties>(
505
+ Q, 5 , 5 , DG2OrPVCProps );
506
+ Passed &= testUSM<T, 4 * I32Factor, !CheckMask, CheckProperties>(
507
+ Q, 5 , 5 , DG2OrPVCProps );
508
+ Passed &= testUSM<T, 8 * I32Factor, !CheckMask, CheckProperties>(
509
+ Q, 5 , 5 , DG2OrPVCProps );
510
+ Passed &= testUSM<T, 16 * I32Factor, CheckMask, CheckProperties>(
511
+ Q, 5 , 5 , DG2OrPVCProps );
512
+ Passed &= testUSM<T, 32 * I32Factor, !CheckMask, CheckProperties>(
513
+ Q, 2 , 4 , DG2OrPVCProps );
512
514
513
515
// This call (potentially) and the next call (guaranteed) store the biggest
514
516
// store-able chunk, which requires storing with 8-byte elements, which
515
517
// requires the alignment to be 8-bytes or more.
516
518
properties PVCAlign8Props{cache_hint_L1<cache_hint::write_back>,
517
519
cache_hint_L2<cache_hint::write_back>,
518
520
alignment<8 >};
519
- Passed &= testUSM<T, 64 * I32Factor, !CheckMask, CheckProperties>(
520
- Q, 7 , 1 , PVCAlign8Props);
521
- if constexpr (sizeof (T) <= 4 )
522
- Passed &= testUSM<T, 128 * I32Factor, CheckMask, CheckProperties>(
523
- Q, 1 , 4 , PVCAlign8Props);
521
+ if constexpr (Features == TestFeatures::PVC) {
522
+ Passed &= testUSM<T, 64 * I32Factor, !CheckMask, CheckProperties>(
523
+ Q, 7 , 1 , PVCAlign8Props);
524
+ if constexpr (sizeof (T) <= 4 )
525
+ Passed &= testUSM<T, 128 * I32Factor, CheckMask, CheckProperties>(
526
+ Q, 1 , 4 , PVCAlign8Props);
527
+ }
524
528
525
529
} // TestPVCFeatures
526
530
527
531
return Passed;
528
532
}
529
533
530
- template <typename T, bool TestPVCFeatures> bool test_block_store_acc (queue Q) {
534
+ template <typename T, TestFeatures Features>
535
+ bool test_block_store_acc (queue Q) {
531
536
constexpr bool CheckMask = true ;
532
537
constexpr bool CheckProperties = true ;
533
538
properties Align16Props{alignment<16 >};
534
539
properties AlignElemProps{alignment<sizeof (T)>};
535
540
536
541
bool Passed = true ;
537
542
538
- // Test block_store() that is available on Gen12 and PVC.
543
+ // Test block_store() that is available on Gen12, DG2 and PVC.
539
544
540
545
if constexpr (sizeof (T) >= 4 )
541
546
Passed &= testACC<T, 4 , !CheckMask, CheckProperties>(Q, 2 , 4 , Align16Props);
@@ -557,49 +562,52 @@ template <typename T, bool TestPVCFeatures> bool test_block_store_acc(queue Q) {
557
562
Passed &=
558
563
testACC<T, 32 , !CheckMask, !CheckProperties>(Q, 2 , 4 , Align16Props);
559
564
560
- if constexpr (TestPVCFeatures) {
561
- // Using cache hints adds the requirement to run tests on PVC.
562
- // Also, PVC variant currently requires a) power-or-two elements,
565
+ if constexpr (Features == TestFeatures::PVC ||
566
+ Features == TestFeatures::DG2) {
567
+ // Using cache hints adds the requirement to run tests on DG2/PVC.
568
+ // Also, DG2/PVC variant currently requires a) power-or-two elements,
563
569
// b) the number of bytes stored per call must not exceed 512,
564
570
// c) the alignment of USM ptr + offset to be 4 or 8-bytes(for 8-byte
565
571
// element vectors).
566
572
constexpr size_t RequiredAlignment = sizeof (T) <= 4 ? 4 : 8 ;
567
- properties PVCProps {cache_hint_L1<cache_hint::write_back>,
568
- cache_hint_L2<cache_hint::write_back>,
569
- alignment<RequiredAlignment>};
573
+ properties DG2OrPVCProps {cache_hint_L1<cache_hint::write_back>,
574
+ cache_hint_L2<cache_hint::write_back>,
575
+ alignment<RequiredAlignment>};
570
576
// Only d/q-words are supported now.
571
577
// Thus we use this I32Factor for testing purposes and convenience.
572
578
constexpr int I32Factor =
573
579
std::max (static_cast <int >(sizeof (int ) / sizeof (T)), 1 );
574
580
575
- Passed &= testACC<T, 1 * I32Factor, !CheckMask, CheckProperties>(Q, 2 , 4 ,
576
- PVCProps );
577
- Passed &= testACC<T, 2 * I32Factor, !CheckMask, CheckProperties>(Q, 5 , 5 ,
578
- PVCProps );
579
- Passed &= testACC<T, 4 * I32Factor, !CheckMask, CheckProperties>(Q, 5 , 5 ,
580
- PVCProps );
581
- Passed &= testACC<T, 8 * I32Factor, !CheckMask, CheckProperties>(Q, 5 , 5 ,
582
- PVCProps );
583
- Passed &= testACC<T, 16 * I32Factor, CheckMask, CheckProperties>(Q, 5 , 5 ,
584
- PVCProps );
585
- Passed &= testACC<T, 32 * I32Factor, !CheckMask, CheckProperties>(Q, 2 , 4 ,
586
- PVCProps );
581
+ Passed &= testACC<T, 1 * I32Factor, !CheckMask, CheckProperties>(
582
+ Q, 2 , 4 , DG2OrPVCProps );
583
+ Passed &= testACC<T, 2 * I32Factor, !CheckMask, CheckProperties>(
584
+ Q, 5 , 5 , DG2OrPVCProps );
585
+ Passed &= testACC<T, 4 * I32Factor, !CheckMask, CheckProperties>(
586
+ Q, 5 , 5 , DG2OrPVCProps );
587
+ Passed &= testACC<T, 8 * I32Factor, !CheckMask, CheckProperties>(
588
+ Q, 5 , 5 , DG2OrPVCProps );
589
+ Passed &= testACC<T, 16 * I32Factor, CheckMask, CheckProperties>(
590
+ Q, 5 , 5 , DG2OrPVCProps );
591
+ Passed &= testACC<T, 32 * I32Factor, !CheckMask, CheckProperties>(
592
+ Q, 2 , 4 , DG2OrPVCProps );
587
593
588
594
// This call (potentially) and the next call (guaranteed) store the biggest
589
595
// store-able chunk, which requires storing with 8-byte elements, which
590
596
// requires the alignment to be 8-bytes or more.
591
597
properties PVCAlign8Props{cache_hint_L1<cache_hint::write_back>,
592
598
cache_hint_L2<cache_hint::write_back>,
593
599
alignment<8 >};
594
- Passed &= testACC<T, 64 * I32Factor, !CheckMask, CheckProperties>(
595
- Q, 7 , 1 , PVCAlign8Props);
600
+ if constexpr (Features == TestFeatures::PVC)
601
+ Passed &= testACC<T, 64 * I32Factor, !CheckMask, CheckProperties>(
602
+ Q, 7 , 1 , PVCAlign8Props);
596
603
597
604
} // TestPVCFeatures
598
605
599
606
return Passed;
600
607
}
601
608
602
- template <typename T, bool TestPVCFeatures> bool test_block_store_slm (queue Q) {
609
+ template <typename T, TestFeatures Features>
610
+ bool test_block_store_slm (queue Q) {
603
611
constexpr bool CheckMerge = true ;
604
612
constexpr bool CheckMask = true ;
605
613
constexpr bool CheckProperties = true ;
@@ -639,42 +647,44 @@ template <typename T, bool TestPVCFeatures> bool test_block_store_slm(queue Q) {
639
647
testSLM<T, 113 , !CheckMask, CheckProperties>(Q, 2 , AlignElemProps);
640
648
}
641
649
642
- if constexpr (TestPVCFeatures) {
643
- // Using the mask adds the requirement to run tests on PVC.
644
- // Also, PVC variant currently requires power-or-two elements and
650
+ if constexpr (Features == TestFeatures::PVC ||
651
+ Features == TestFeatures::DG2) {
652
+ // Using the mask adds the requirement to run tests on DG2/PVC.
653
+ // Also, DG2/PVC variant currently requires power-or-two elements and
645
654
// the number of bytes stored per call must not exceed 512.
646
655
647
656
constexpr int I32Factor =
648
657
std::max (static_cast <int >(sizeof (int ) / sizeof (T)), 1 );
649
658
constexpr size_t RequiredAlignment = sizeof (T) <= 4 ? 4 : 8 ;
650
- properties PVCProps {alignment<RequiredAlignment>,
651
- cache_hint_L1<cache_hint::write_back>,
652
- cache_hint_L2<cache_hint::write_back>};
659
+ properties DG2OrPVCProps {alignment<RequiredAlignment>,
660
+ cache_hint_L1<cache_hint::write_back>,
661
+ cache_hint_L2<cache_hint::write_back>};
653
662
654
663
// Test block_store() that is available on PVC:
655
664
// 1, 2, 3, 4, 8, ... N elements (up to 512-bytes).
656
- Passed &=
657
- testSLM<T, 1 * I32Factor, CheckMask, CheckProperties>(Q, 2 , PVCProps);
658
- Passed &=
659
- testSLM<T, 2 * I32Factor, CheckMask, CheckProperties>(Q, 1 , PVCProps);
660
- Passed &=
661
- testSLM<T, 3 * I32Factor, CheckMask, CheckProperties>(Q, 2 , PVCProps);
662
- Passed &=
663
- testSLM<T, 4 * I32Factor, CheckMask, CheckProperties>(Q, 2 , PVCProps);
664
- Passed &=
665
- testSLM<T, 8 * I32Factor, CheckMask, CheckProperties>(Q, 1 , PVCProps);
666
- Passed &=
667
- testSLM<T, 16 * I32Factor, CheckMask, CheckProperties>(Q, 8 , PVCProps);
668
- Passed &=
669
- testSLM<T, 32 * I32Factor, CheckMask, CheckProperties>(Q, 2 , PVCProps);
670
- Passed &=
671
- testSLM<T, 64 * I32Factor, CheckMask, !CheckProperties>(Q, 2 , PVCProps);
665
+ Passed &= testSLM<T, 1 * I32Factor, CheckMask, CheckProperties>(
666
+ Q, 2 , DG2OrPVCProps);
667
+ Passed &= testSLM<T, 2 * I32Factor, CheckMask, CheckProperties>(
668
+ Q, 1 , DG2OrPVCProps);
669
+ Passed &= testSLM<T, 3 * I32Factor, CheckMask, CheckProperties>(
670
+ Q, 2 , DG2OrPVCProps);
671
+ Passed &= testSLM<T, 4 * I32Factor, CheckMask, CheckProperties>(
672
+ Q, 2 , DG2OrPVCProps);
673
+ Passed &= testSLM<T, 8 * I32Factor, CheckMask, CheckProperties>(
674
+ Q, 1 , DG2OrPVCProps);
675
+ Passed &= testSLM<T, 16 * I32Factor, CheckMask, CheckProperties>(
676
+ Q, 8 , DG2OrPVCProps);
677
+ Passed &= testSLM<T, 32 * I32Factor, CheckMask, CheckProperties>(
678
+ Q, 2 , DG2OrPVCProps);
679
+ if constexpr (Features == TestFeatures::PVC)
680
+ Passed &= testSLM<T, 64 * I32Factor, CheckMask, !CheckProperties>(
681
+ Q, 2 , DG2OrPVCProps);
672
682
} // TestPVCFeatures
673
683
674
684
return Passed;
675
685
}
676
686
677
- template <typename T, bool TestPVCFeatures >
687
+ template <typename T, TestFeatures Features >
678
688
bool test_block_store_local_acc_slm (queue Q) {
679
689
constexpr bool CheckMerge = true ;
680
690
constexpr bool CheckMask = true ;
@@ -731,36 +741,38 @@ bool test_block_store_local_acc_slm(queue Q) {
731
741
Q, 2 , AlignElemProps);
732
742
}
733
743
734
- if constexpr (TestPVCFeatures) {
735
- // Using the mask adds the requirement to run tests on PVC.
736
- // Also, PVC variant currently requires power-or-two elements and
744
+ if constexpr (Features == TestFeatures::PVC ||
745
+ Features == TestFeatures::DG2) {
746
+ // Using the mask adds the requirement to run tests on DG2/PVC.
747
+ // Also, DG2/PVC variant currently requires power-or-two elements and
737
748
// the number of bytes stored per call must not exceed 512.
738
749
739
750
constexpr int I32Factor =
740
751
std::max (static_cast <int >(sizeof (int ) / sizeof (T)), 1 );
741
752
constexpr size_t ReqiredAlignment = sizeof (T) <= 4 ? 4 : 8 ;
742
- properties PVCProps {alignment<ReqiredAlignment>,
743
- cache_hint_L1<cache_hint::write_back>,
744
- cache_hint_L2<cache_hint::write_back>};
753
+ properties DG2OrPVCProps {alignment<ReqiredAlignment>,
754
+ cache_hint_L1<cache_hint::write_back>,
755
+ cache_hint_L2<cache_hint::write_back>};
745
756
746
757
// Test block_store() that is available on PVC:
747
758
// 1, 2, 3, 4, 8, ... N elements (up to 512-bytes).
748
759
Passed &= testLocalAccSLM<T, 1 * I32Factor, CheckMask, CheckProperties>(
749
- Q, 2 , PVCProps );
760
+ Q, 2 , DG2OrPVCProps );
750
761
Passed &= testLocalAccSLM<T, 2 * I32Factor, CheckMask, CheckProperties>(
751
- Q, 1 , PVCProps );
762
+ Q, 1 , DG2OrPVCProps );
752
763
Passed &= testLocalAccSLM<T, 3 * I32Factor, CheckMask, CheckProperties>(
753
- Q, 2 , PVCProps );
764
+ Q, 2 , DG2OrPVCProps );
754
765
Passed &= testLocalAccSLM<T, 4 * I32Factor, CheckMask, CheckProperties>(
755
- Q, 2 , PVCProps );
766
+ Q, 2 , DG2OrPVCProps );
756
767
Passed &= testLocalAccSLM<T, 8 * I32Factor, CheckMask, CheckProperties>(
757
- Q, 1 , PVCProps );
768
+ Q, 1 , DG2OrPVCProps );
758
769
Passed &= testLocalAccSLM<T, 16 * I32Factor, CheckMask, CheckProperties>(
759
- Q, 8 , PVCProps );
770
+ Q, 8 , DG2OrPVCProps );
760
771
Passed &= testLocalAccSLM<T, 32 * I32Factor, CheckMask, CheckProperties>(
761
- Q, 2 , PVCProps);
762
- Passed &= testLocalAccSLM<T, 64 * I32Factor, CheckMask, !CheckProperties>(
763
- Q, 2 , PVCProps);
772
+ Q, 2 , DG2OrPVCProps);
773
+ if constexpr (Features == TestFeatures::PVC)
774
+ Passed &= testLocalAccSLM<T, 64 * I32Factor, CheckMask, !CheckProperties>(
775
+ Q, 2 , DG2OrPVCProps);
764
776
} // TestPVCFeatures
765
777
766
778
return Passed;
0 commit comments