1
+ BEGIN
2
+ {
3
+ use lib $ENV {ICS_PERLLIB };
4
+ }
5
+ use icpuid;
6
+
1
7
use File::Basename;
2
8
use File::Copy;
3
9
@@ -34,6 +40,10 @@ sub gpu {
34
40
$gpus = [ $gpus ] if ref ($gpus ) ne " ARRAY" ;
35
41
my $current_gpu = $ENV {' CURRENT_GPU_DEVICE' };
36
42
if (!defined $current_gpu ) {
43
+ my @avaliable_gpu_features = get_gpu_features();
44
+ foreach my $gpu (@{$gpus }) {
45
+ return 1 if (grep (/ $gpu /i , @avaliable_gpu_features ));
46
+ }
37
47
return 0;
38
48
} else {
39
49
$current_gpu =~ tr / ,// d; # e.g. gen9,/gen9/double/,GEN9
@@ -582,6 +592,8 @@ sub do_run
582
592
my $jobset = " -j 8" ;
583
593
my $zedebug = " " ;
584
594
my $gpu_opts = " " ;
595
+ my $sycl2020_aspects = " " ;
596
+ my $sycl2020_non_aspect_features = " " ;
585
597
586
598
if ( is_ats() ) {
587
599
$python = " /usr/bin/python3" ;
@@ -605,12 +617,45 @@ sub do_run
605
617
$timeset = " --timeout 0" ;
606
618
}
607
619
608
- if (gpu([' dg1' ,' ats' ])) {
609
- $gpu_opts .= " -Dgpu-intel-dg1=1" ;
610
- } elsif (gpu([' dg2' ])) {
611
- $gpu_opts .= " -Dgpu-intel-dg2=1" ;
612
- } elsif (gpu([' pvc' ])) {
613
- $gpu_opts .= " -Dgpu-intel-pvc=1" ;
620
+ # Detail lit-feature-checks in https://github.com/intel/llvm-test-suite/tree/intel/SYCL#lit-feature-checks
621
+ # Platform names that appear in external user interactions (e.g. command-line arguments) should be all lowercase, with dashes (-).
622
+ # Platform names that appear in external user interactions in Open Source (OS) version of SW tools must come from any of the following URL:
623
+ # https://github.com/intel-innersource/drivers.gpu.specification.platforms/blob/generated_cs/gen/templates/doc/listing.md#listing-of-all-known-gpu-platforms
624
+ # FAMILY
625
+ if (gpu([' gen9' ])) {
626
+ $gpu_opts .= " -Dgpu-intel-gen9=1 " ;
627
+ }
628
+ if (gpu([' gen11' ])) {
629
+ $gpu_opts .= " -Dgpu-intel-gen11=1 " ;
630
+ }
631
+ if (gpu([' gen12' ])) {
632
+ $gpu_opts .= " -Dgpu-intel-gen12=1 " ;
633
+ }
634
+ # DEVICE
635
+ if (gpu([' ats' ])) {
636
+ $gpu_opts .= " -Dgpu-intel-ats=1 " ;
637
+ }
638
+ if (gpu([' atsm' ])) {
639
+ $gpu_opts .= " -Dgpu-intel-ats-m=1 " ;
640
+ }
641
+ if (gpu([' dg1' ])) {
642
+ $gpu_opts .= " -Dgpu-intel-dg1=1 " ;
643
+ }
644
+ if (gpu([' dg2' ])) {
645
+ $gpu_opts .= " -Dgpu-intel-acm=1 " ;
646
+ }
647
+ if (gpu([' pvc' ])) {
648
+ $gpu_opts .= " -Dgpu-intel-pvc=1 " ;
649
+ }
650
+
651
+ # SYCL 2020 device aspects: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:device-aspects
652
+ # ASPECT
653
+ if ($current_optset !~ m / gpu/ or gpu([' double' ])) {
654
+ $sycl2020_aspects .= " -Daspect-fp64=1 " ;
655
+ }
656
+ # SUPPORTS
657
+ if (gpu([' subdevice' ])) {
658
+ $sycl2020_non_aspect_features .= " -Dsupports-subdevice=1 " ;
614
659
}
615
660
616
661
my $backward_compatibility_opts = " " ;
@@ -627,9 +672,9 @@ sub do_run
627
672
628
673
set_tool_path();
629
674
if ($is_dynamic_suite == 1 or is_suite()) {
630
- execute(" $python $lit -a $backward_compatibility_opts $gpu_opts $matrix $zedebug $jobset . $timeset > $run_all_lf 2>&1" );
675
+ execute(" $python $lit -a $backward_compatibility_opts $sycl2020_aspects $sycl2020_non_aspect_features $ gpu_opts $matrix $zedebug $jobset . $timeset > $run_all_lf 2>&1" );
631
676
} else {
632
- execute(" $python $lit -a $gpu_opts $matrix $zedebug $path $timeset " );
677
+ execute(" $python $lit -a $sycl2020_aspects $sycl2020_non_aspect_features $ gpu_opts $matrix $zedebug $path $timeset " );
633
678
}
634
679
}
635
680
@@ -1061,19 +1106,11 @@ sub print2file
1061
1106
}
1062
1107
1063
1108
sub is_ats {
1064
- my $current_gpu = $ENV {' CURRENT_GPU_DEVICE' };
1065
- if (defined $current_gpu && $current_gpu =~ m / ats/ i ) {
1066
- return 1;
1067
- }
1068
- return 0;
1109
+ return gpu(" ats" );
1069
1110
}
1070
1111
1071
1112
sub is_pvc {
1072
- my $current_gpu = $ENV {' CURRENT_GPU_DEVICE' };
1073
- if (defined $current_gpu && $current_gpu =~ m / pvc/ i ) {
1074
- return 1;
1075
- }
1076
- return 0;
1113
+ return gpu(" pvc" );
1077
1114
}
1078
1115
1079
1116
sub append2file
@@ -1106,3 +1143,4 @@ sub CleanupTest {
1106
1143
1107
1144
1;
1108
1145
1146
+
0 commit comments