Skip to content

Commit

Permalink
Separate some test cases that need to be tested on the cuda backend
Browse files Browse the repository at this point in the history
Signed-off-by: Ni, Wenhui <wenhui.ni@intel.com>
  • Loading branch information
wenhuiNi committed May 31, 2023
1 parent e0921ee commit 2d6b2c6
Show file tree
Hide file tree
Showing 30 changed files with 112 additions and 45 deletions.
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_backprop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/backprop" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_constant_attr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<file path="feature_case/constant_attr/use_header2.cu" />
<file path="feature_case/constant_attr/constant_array.cuh" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_defaultStream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/driverStreamAndEvent/defaultStream.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_deviceAPI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/deviceAPI/${testName}.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_deviceProp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/deviceProp/deviceProp.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
2 changes: 2 additions & 0 deletions features/config/TEMPLATE_device_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<rules>
<platformRule OSFamily="Linux" kit="CUDA10.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA10.2" kitRange="OLDER" runOnThisPlatform="false"/>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>

</test>
3 changes: 3 additions & 0 deletions features/config/TEMPLATE_driverCtx.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<files>
<file path="feature_case/driverCtx/driverCtx.cu" />
</files>
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_driverDevice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/driverDevice/driverDevice.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_driverMem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
</files>
<rules>
<optlevelRule excludeOptlevelNameString="usmnone" />
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_driverStreamAndEvent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/driverStreamAndEvent/driverStreamAndEvent.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
3 changes: 3 additions & 0 deletions features/config/TEMPLATE_driverTex.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<files>
<file path="feature_case/driverTex/driverTex.cu" />
</files>
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_feature_profiling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/feature_profiling/${testName}.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_freeQueries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<file path="feature_case/freeQueries/free-queries.cu" />
</files>
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
<platformRule OSFamily="Linux" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/>
</rules>
Expand Down
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_gridThreads.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/deviceProp/gridThreads.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_macro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/macro/macro.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_math_after_11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<rules>
<platformRule OSFamily="Linux" kit="CUDA11.0" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA11.0" kitRange="OLDER" runOnThisPlatform="false"/>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_math_drcp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
</files>
<rules>
<optlevelRule GPUFeature="NOT double" excludeOptlevelNameString="gpu" />
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
3 changes: 2 additions & 1 deletion features/config/TEMPLATE_math_exec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<file path="feature_case/math/${testName}.cu" />
</files>
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
<platformRule OSFamily="Linux" kit="CUDA11.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA11.2" kitRange="OLDER" runOnThisPlatform="false"/>
<optlevelRule GPUFeature="NOT double" excludeOptlevelNameString="gpu" />
<optlevelRule GPUFeature="NOT double" excludeOptlevelNameString="gpu" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_math_habs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<file path="feature_case/math/${testName}.cu" />
</files>
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
<optlevelRule excludeOptlevelNameString="cpu" />
<platformRule OSFamily="Linux" kit="CUDA10.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA10.2" kitRange="OLDER" runOnThisPlatform="false"/>
Expand Down
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_memory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/memory/${testName}.cu" />
</files>

<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_misc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/misc/${testName}.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_misc_excluding_80.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<rules>
<platformRule OSFamily="Linux" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_perm_byte.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/perm_byte/${testName}.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
1 change: 1 addition & 0 deletions features/config/TEMPLATE_pointer_attributes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<platformRule OSFamily="Linux" kit="CUDA10.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA10.2" kitRange="OLDER" runOnThisPlatform="false"/>
<optlevelRule excludeOptlevelNameString="usmnone" />
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion features/config/TEMPLATE_runtimeAPI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<files>
<file path="feature_case/runtimeAPI/${testName}.cu" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
3 changes: 2 additions & 1 deletion features/config/TEMPLATE_thrust-qmc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<optlevelRule excludeOptlevelNameString="usmnone" />
<platformRule OSFamily="Linux" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/>
<platformRule OSFamily="Windows" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/>
<optlevelRule GPUFeature="NOT double" excludeOptlevelNameString="gpu" />
<optlevelRule GPUFeature="NOT double" excludeOptlevelNameString="gpu" />
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<test driverID="test_help" name="TEMPLATE">
<description>test help function</description>
<files>
<file path="src/${testName}.cpp" />
</files>
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
4 changes: 3 additions & 1 deletion help_function/config/test_default_queue_2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
<file path="src/test_default_queue_2.cpp" />
<file path="src/test_default_queue_1.cpp" />
</files>
<rules />
<rules>
<optlevelRule enableSpecialPlatform="cuda" />
</rules>
</test>
50 changes: 25 additions & 25 deletions help_function/help_function.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,42 @@
<suite>
<description>Test the helper function</description>
<tests>
<test testName="array_copy" configFile="config/TEMPLATE_help_function.xml" />
<test testName="assign_device_vector" configFile="config/TEMPLATE_help_function.xml" />
<test testName="move_device_vector" configFile="config/TEMPLATE_help_function.xml" />
<test testName="atomic_add_float" configFile="config/TEMPLATE_help_function.xml" />
<test testName="atomic_fetch_compare_inc" configFile="config/TEMPLATE_help_function.xml" />
<test testName="async_exception" configFile="config/TEMPLATE_help_function.xml" />
<test testName="dpct_device_info" configFile="config/TEMPLATE_help_function.xml" />
<test testName="max" configFile="config/TEMPLATE_help_function.xml" />
<test testName="memcpy3D" configFile="config/TEMPLATE_help_function.xml" />
<test testName="memcpy3D_2" configFile="config/TEMPLATE_help_function.xml" />
<test testName="array_copy" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="assign_device_vector" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="move_device_vector" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="atomic_add_float" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="atomic_fetch_compare_inc" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="async_exception" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="dpct_device_info" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="max" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="memcpy3D" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="memcpy3D_2" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<!-- <test testName="memory_management_test1" configFile="config/TEMPLATE_help_function.xml" />
<test testName="memory_management_test2" configFile="config/TEMPLATE_help_function.xml" />
<test testName="memory_management_test3" configFile="config/TEMPLATE_help_function.xml" /> -->
<test testName="global_memory" configFile="config/TEMPLATE_help_function.xml" />
<test testName="global_memory_usm" configFile="config/TEMPLATE_help_function.xml" />
<test testName="shared_memory" configFile="config/TEMPLATE_help_function.xml" />
<test testName="shared_memory_usm" configFile="config/TEMPLATE_help_function.xml" />
<test testName="global_memory" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="global_memory_usm" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="shared_memory" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="shared_memory_usm" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="test_default_queue_2" configFile="config/test_default_queue_2.xml" />
<test testName="image_wrapper" configFile="config/image_wrapper.xml" />
<test testName="thrust_test_device_ptr_2" configFile="config/TEMPLATE_help_function.xml" />
<test testName="thrust_test-pennet_simple_pstl" configFile="config/TEMPLATE_help_function.xml" />
<test testName="image_array" configFile="image_array/config/image_array.xml" />
<test testName="test_complex" configFile="config/TEMPLATE_help_function.xml" />
<test testName="math_function" configFile="config/TEMPLATE_help_function.xml" />
<test testName="math_function" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="cpu_device_index_initializaion_test" configFile="config/cpu_device_index_initializaion_test.xml" />
<test testName="image_wrapper_usm" configFile="config/TEMPLATE_syclct_help_function_image_wrapper_usm.xml" />
<test testName="image_wrapper_2_usm" configFile="config/TEMPLATE_syclct_help_function_image_wrapper_usm.xml" />
<test testName="memory_async_dpct_free" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="memory_async_dpct_free" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="memory_is_device_ptr" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="dpct_dpct_align_and_dpct_inline" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="dpct_dpct_compatibility_temp" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="dpct_dpct_align_and_dpct_inline" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="dpct_dpct_compatibility_temp" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="dpct_dpct_pi_f" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="dpct_dpct_pi" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="atomic_atomic_fetch_sub" configFile="config/TEMPLATE_help_function_usm.xml" />
<test testName="atomic_atomic_fetch_sub" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="atomics_noneusm_verification" configFile="config/TEMPLATE_help_function.xml" />
<test testName="atomics_usm_verification" configFile="config/TEMPLATE_help_function.xml" />
<test testName="atomics_usm_verification" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="blas_utils_getrf" configFile="config/TEMPLATE_help_function_blas_usmnone.xml" splitGroup="double"/>
<test testName="blas_utils_getrf-usm" configFile="config/TEMPLATE_help_function_blas_usm.xml" splitGroup="double"/>
<test testName="blas_utils_getrf-complex" configFile="config/TEMPLATE_help_function_blas_usmnone.xml" splitGroup="double"/>
Expand Down Expand Up @@ -73,10 +73,10 @@
<test testName="util_vectorized_max_test" configFile="config/TEMPLATE_help_function.xml" />
<test testName="util_vectorized_min_test" configFile="config/TEMPLATE_help_function.xml" />
<test testName="util_DataType_test" configFile="config/TEMPLATE_help_function.xml" />
<test testName="device_util" configFile="config/TEMPLATE_help_function.xml" />
<test testName="device_dev_mgr" configFile="config/TEMPLATE_help_function.xml" />
<test testName="device_device_ext" configFile="config/TEMPLATE_help_function.xml" />
<test testName="device_device_info" configFile="config/TEMPLATE_help_function.xml" />
<test testName="device_util" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="device_dev_mgr" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="device_device_ext" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="device_device_info" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
<test testName="image_image_channel" configFile="config/TEMPLATE_help_function.xml" />
<test testName="image_image_matrix" configFile="config/TEMPLATE_help_function.xml" />
<test testName="image_image_data" configFile="config/TEMPLATE_help_function.xml" />
Expand Down Expand Up @@ -179,6 +179,6 @@
<test testName="sparse_utils_1" configFile="config/TEMPLATE_help_function.xml" />
<test testName="sparse_utils_2_buffer" configFile="config/TEMPLATE_help_function_before_11_skip_double.xml" splitGroup="double" />
<test testName="sparse_utils_2_usm" configFile="config/TEMPLATE_help_function_before_11_skip_double.xml" splitGroup="double" />
<test testName="atomic_compare_exchange_strong" configFile="config/TEMPLATE_help_function.xml" />
<test testName="atomic_compare_exchange_strong" configFile="config/TEMPLATE_help_function_eanble_cuda_backend.xml" />
</tests>
</suite>
15 changes: 12 additions & 3 deletions run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ def __init__(self, case_name, os_family, run_on_this_platform, cuda_verion="", c
self.cuda_range = cuda_range

class option_rule:
def __init__(self, case_name, exclude_option, only_option, not_double_type_feature):
def __init__(self, case_name, exclude_option, only_option, not_double_type_feature, enable_special_platform):
self.name = case_name
self.exclude_option = exclude_option
self.only_option = only_option
self.not_double_type_feature = not_double_type_feature
self.enable_special_platform = enable_special_platform

class case_config:
def __init__(self, case_name, test_dep_files, option_rule_list, platform_rule_list,
Expand Down Expand Up @@ -113,13 +114,16 @@ def prepare_test_case(case_name, test_config_path, root_path, split_group):
exclude_option = ""
only_option = ""
not_double_type_feature = ""
enable_special_platform = ""
if "excludeOptlevelNameString" in rule.attrib:
exclude_option = str(rule.get("excludeOptlevelNameString"))
if "onlyOptlevelNameString" in rule.attrib:
only_option = str(rule.get("onlyOptlevelNameString"))
if "GPUFeature" in rule.attrib:
not_double_type_feature = str(rule.get("GPUFeature"))
option_rules.append(option_rule(case_name, exclude_option, only_option, not_double_type_feature))
if "enableSpecialPlatform" in rule.attrib:
enable_special_platform = str(rule.get("enableSpecialPlatform"))
option_rules.append(option_rule(case_name, exclude_option, only_option, not_double_type_feature, enable_special_platform))

for rule in root.iter("platformRule"):
rule_osfamily = str(rule.get("OSFamily"))
Expand Down Expand Up @@ -264,6 +268,8 @@ def is_platform_supported(platform_rule_list):

def is_option_supported(option_rule_list):
for option_rule in option_rule_list:
if test_config.test_option == "option_cuda":
return option_rule.enable_special_platform=="cuda"
if option_rule.exclude_option != "" and option_rule.exclude_option in test_config.test_option and not option_rule.not_double_type_feature:
return False
elif option_rule.only_option not in test_config.test_option:
Expand All @@ -282,7 +288,10 @@ def test_single_case(current_test, single_case_config, workspace, module, suite_
if single_case_config.option_rule_list and not is_option_supported(single_case_config.option_rule_list):
append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n")
return True

if not single_case_config.option_rule_list and test_config.test_option == "option_cuda":
append_msg_to_file(test_config.result_text, current_test + " Skip " + "\n")
return True

case_workspace = os.path.join(workspace, current_test)
if not os.path.exists(case_workspace):
os.makedirs(case_workspace)
Expand Down

0 comments on commit 2d6b2c6

Please sign in to comment.