@@ -88,15 +88,21 @@ def __init__(self, single_run_config, case_name, command_file = "", command_text
88
88
self .migrate_option = single_run_config .migrate_option
89
89
self .timeout = single_run_config .timeout
90
90
self .device_filter = single_run_config .device_filter
91
+ self .cuda_ver = single_run_config .cuda_ver
92
+ self .test_option = single_run_config .test_option
93
+ self .device = single_run_config .device
91
94
92
95
class case_run_config :
93
- def __init__ (self , DPCXX_COM , CT_TOOL , include_path , migrate_option , timeout , device_filter ):
96
+ def __init__ (self , DPCXX_COM , CT_TOOL , include_path , migrate_option , timeout , device_filter , cuda_ver , test_option , backend_device ):
94
97
self .DPCXX_COM = DPCXX_COM
95
98
self .CT_TOOL = CT_TOOL
96
99
self .include_path = include_path
97
100
self .migrate_option = migrate_option
98
101
self .timeout = timeout
99
102
self .device_filter = device_filter
103
+ self .cuda_ver = cuda_ver
104
+ self .test_option = test_option
105
+ self .device = backend_device
100
106
101
107
102
108
def parse_suite_cfg (suite_name , root_path ):
@@ -276,37 +282,37 @@ def run_test_driver(module, single_case_text):
276
282
# Rule1:skip < CUDA 9.2
277
283
# Rule2:skip > CUDA 11.4
278
284
# Not supported
279
- def is_platform_supported (platform_rule_list ):
285
+ def is_platform_supported (platform_rule_list , single_case_text ):
280
286
for platform_rule in platform_rule_list :
281
287
if platform_rule .os_family != platform .system ():
282
288
continue
283
289
if platform_rule .cuda_version :
284
290
version = int (float (re .findall ("\d+\.?\d*" , platform_rule .cuda_version )[0 ])) * 1000
285
291
print_debug_log ("CUDA version is " , version )
286
- print_debug_log ("default CUDA version is " , test_config .cuda_ver )
292
+ print_debug_log ("default CUDA version is " , single_case_text .cuda_ver )
287
293
print_debug_log ("default CUDA range is " , platform_rule .cuda_range )
288
- if platform_rule .cuda_range == "LATER_OR_EQUAL" and test_config .cuda_ver >= version and platform_rule .run_on_this_platform .upper () == "FALSE" :
294
+ if platform_rule .cuda_range == "LATER_OR_EQUAL" and single_case_text .cuda_ver >= version and platform_rule .run_on_this_platform .upper () == "FALSE" :
289
295
return False
290
- elif platform_rule .cuda_range == "OLDER" and test_config .cuda_ver < version and platform_rule .run_on_this_platform .upper () == "FALSE" :
296
+ elif platform_rule .cuda_range == "OLDER" and single_case_text .cuda_ver < version and platform_rule .run_on_this_platform .upper () == "FALSE" :
291
297
return False
292
- elif platform_rule .cuda_range == "LATER" and test_config .cuda_ver > version and platform_rule .run_on_this_platform .upper () == "FALSE" :
298
+ elif platform_rule .cuda_range == "LATER" and single_case_text .cuda_ver > version and platform_rule .run_on_this_platform .upper () == "FALSE" :
293
299
return False
294
- elif platform_rule .cuda_range == "OLDER_OR_EQUAL" and test_config .cuda_ver <= version and platform_rule .run_on_this_platform .upper () == "FALSE" :
300
+ elif platform_rule .cuda_range == "OLDER_OR_EQUAL" and single_case_text .cuda_ver <= version and platform_rule .run_on_this_platform .upper () == "FALSE" :
295
301
return False
296
- elif platform_rule .cuda_range == "EQUAL" and test_config .cuda_ver == version and platform_rule .run_on_this_platform .upper () == "FALSE" :
302
+ elif platform_rule .cuda_range == "EQUAL" and single_case_text .cuda_ver == version and platform_rule .run_on_this_platform .upper () == "FALSE" :
297
303
return False
298
304
else :
299
305
return platform_rule .run_on_this_platform .upper () == "TRUE"
300
306
return True
301
307
302
- def is_option_supported (option_rule_list ):
308
+ def is_option_supported (option_rule_list , single_case_text ):
303
309
for option_rule in option_rule_list :
304
- if option_rule .exclude_option != "" and option_rule .exclude_option in test_config .test_option and not option_rule .not_double_type_feature :
310
+ if option_rule .exclude_option != "" and option_rule .exclude_option in single_case_text .test_option and not option_rule .not_double_type_feature :
305
311
return False
306
- elif option_rule .only_option not in test_config .test_option :
312
+ elif option_rule .only_option not in single_case_text .test_option :
307
313
return False
308
- elif option_rule .exclude_option in test_config .test_option and option_rule .not_double_type_feature == "NOT double" :
309
- if test_config . backend_device not in test_config .support_double_gpu :
314
+ elif option_rule .exclude_option in single_case_text .test_option and option_rule .not_double_type_feature == "NOT double" :
315
+ if single_case_text . device not in test_config .support_double_gpu :
310
316
return False
311
317
return True
312
318
@@ -315,12 +321,12 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa
315
321
os .path .join (workspace , current_test + ".lf" ), "" ,
316
322
os .path .join (workspace , "result.md" ), "" , "" )
317
323
module = import_test_driver (suite_root_path )
318
- if single_case_config .platform_rule_list and not is_platform_supported (single_case_config .platform_rule_list ):
324
+ if single_case_config .platform_rule_list and not is_platform_supported (single_case_config .platform_rule_list , single_case_text ):
319
325
single_case_text .result_text += current_test + " Skip " + "\n "
320
326
single_case_text .run_flag = True
321
327
return single_case_text
322
328
323
- if single_case_config .option_rule_list and not is_option_supported (single_case_config .option_rule_list ):
329
+ if single_case_config .option_rule_list and not is_option_supported (single_case_config .option_rule_list , single_case_text ):
324
330
single_case_text .result_text += current_test + " Skip " + "\n "
325
331
single_case_text .run_flag = True
326
332
return single_case_text
@@ -382,7 +388,8 @@ def test_suite(suite_root_path, suite_name, opt):
382
388
383
389
for current_test , single_case_config in test_config .suite_cfg .test_config_map .items ():
384
390
single_run_config = case_run_config (test_config .DPCXX_COM , test_config .CT_TOOL , test_config .include_path ,
385
- test_config .migrate_option , test_config .timeout , test_config .device_filter )
391
+ test_config .migrate_option , test_config .timeout , test_config .device_filter ,
392
+ test_config .cuda_ver , test_config .test_option , test_config .backend_device )
386
393
result = pool .apply_async (test_single_case , (current_test , single_case_config , test_workspace ,
387
394
suite_root_path , single_run_config ,))
388
395
# store all msg
@@ -415,7 +422,8 @@ def test_single_case_in_suite(suite_root_path, suite_name, case, option):
415
422
exit ("The test case " + case + " is not in the " + suite_name + " test suite! Please double check." )
416
423
single_case_config = suite_cfg .test_config_map [case ]
417
424
single_run_config = case_run_config (test_config .DPCXX_COM , test_config .CT_TOOL , test_config .include_path ,
418
- test_config .migrate_option , test_config .timeout , test_config .device_filter )
425
+ test_config .migrate_option , test_config .timeout , test_config .device_filter ,
426
+ test_config .cuda_ver , test_config .test_option , test_config .backend_device )
419
427
single_case_text = test_single_case (case , single_case_config , test_workspace , suite_root_path , single_run_config )
420
428
record_msg_case (single_case_text )
421
429
return single_case_text .run_flag
0 commit comments