3
3
import sys
4
4
import os
5
5
import re
6
+ import argparse
6
7
7
8
8
9
def get_latest_release (repo ):
@@ -28,7 +29,20 @@ def get_artifacts_download_url(repo, name):
28
29
return json .loads (artifacts )["artifacts" ][0 ]["archive_download_url" ]
29
30
30
31
31
- def uplift_linux_igfx_driver (config , platform_tag ):
32
+ def uplift_linux_igfx_driver (config , platform_tag ,igc_dev_only ):
33
+
34
+ igc_dev = get_latest_workflow_runs ("intel/intel-graphics-compiler" , "build-IGC" )
35
+ igcdevver = igc_dev ["head_sha" ][:7 ]
36
+ config [platform_tag ]["igc_dev" ]["github_tag" ] = "igc-dev-" + igcdevver
37
+ config [platform_tag ]["igc_dev" ]["version" ] = igcdevver
38
+ config [platform_tag ]["igc_dev" ]["updated_at" ] = igc_dev ["updated_at" ]
39
+ config [platform_tag ]["igc_dev" ]["url" ] = get_artifacts_download_url (
40
+ "intel/intel-graphics-compiler" , "IGC_Ubuntu22.04_llvm14_clang-" + igcdevver
41
+ )
42
+
43
+ if (igc_dev_only ):
44
+ return config
45
+
32
46
compute_runtime = get_latest_release ('intel/compute-runtime' )
33
47
34
48
config [platform_tag ]['compute_runtime' ]['github_tag' ] = compute_runtime ['tag_name' ]
@@ -46,15 +60,6 @@ def uplift_linux_igfx_driver(config, platform_tag):
46
60
config [platform_tag ]['igc' ]['url' ] = 'https://github.com/intel/intel-graphics-compiler/releases/tag/igc-' + ver
47
61
break
48
62
49
- igc_dev = get_latest_workflow_runs ("intel/intel-graphics-compiler" , "build-IGC" )
50
- igcdevver = igc_dev ["head_sha" ][:7 ]
51
- config [platform_tag ]["igc_dev" ]["github_tag" ] = "igc-dev-" + igcdevver
52
- config [platform_tag ]["igc_dev" ]["version" ] = igcdevver
53
- config [platform_tag ]["igc_dev" ]["updated_at" ] = igc_dev ["updated_at" ]
54
- config [platform_tag ]["igc_dev" ]["url" ] = get_artifacts_download_url (
55
- "intel/intel-graphics-compiler" , "IGC_Ubuntu22.04_llvm14_clang-" + igcdevver
56
- )
57
-
58
63
cm = get_latest_release ('intel/cm-compiler' )
59
64
config [platform_tag ]['cm' ]['github_tag' ] = cm ['tag_name' ]
60
65
config [platform_tag ]['cm' ]['version' ] = cm ['tag_name' ].replace ('cmclang-' , '' )
@@ -68,22 +73,28 @@ def uplift_linux_igfx_driver(config, platform_tag):
68
73
return config
69
74
70
75
71
- def main (platform_tag ):
76
+ def main (platform_tag , igc_dev_only ):
72
77
script = os .path .dirname (os .path .realpath (__file__ ))
73
78
config_name = os .path .join (script , '..' , 'dependencies.json' )
74
79
config = {}
75
80
76
81
with open (config_name , "r" ) as f :
77
82
config = json .loads (f .read ())
78
- config = uplift_linux_igfx_driver (config , platform_tag )
83
+ config = uplift_linux_igfx_driver (config , platform_tag , igc_dev_only )
79
84
80
85
with open (config_name , "w" ) as f :
81
86
json .dump (config , f , indent = 2 )
82
87
f .write ('\n ' )
83
88
89
+ if (igc_dev_only ):
90
+ return config [platform_tag ]["igc_dev" ]["github_tag" ]
91
+
84
92
return config [platform_tag ]['compute_runtime' ]['version' ]
85
93
86
94
87
95
if __name__ == '__main__' :
88
- platform_tag = sys .argv [1 ] if len (sys .argv ) > 1 else "ERROR_PLATFORM"
89
- sys .stdout .write (main (platform_tag ) + '\n ' )
96
+ parser = argparse .ArgumentParser ()
97
+ parser .add_argument ('platform_tag' )
98
+ parser .add_argument ('--igc-dev-only' , action = 'store_true' )
99
+ args = parser .parse_args ()
100
+ sys .stdout .write (main (args .platform_tag , args .igc_dev_only ) + '\n ' )
0 commit comments