fe421c89b2
- based on https://github.com/ROCmSoftwarePlatform/hipDNN. - lit testing was supplemented with CUDA_DNN_ROOT_DIR for cuDNN testing. - single cuDNN test was added.
65 lines
2.0 KiB
INI
65 lines
2.0 KiB
INI
# -*- Python -*-
|
|
import os
|
|
import platform
|
|
import re
|
|
import subprocess
|
|
|
|
import lit.formats
|
|
import lit.util
|
|
|
|
# Configuration file for the 'lit' test runner.
|
|
|
|
# name: The name of this test suite.
|
|
config.name = 'hipify'
|
|
|
|
# suffixes: CUDA source is only supported
|
|
config.suffixes = ['.cu','.cuh','.cpp','.c','.hpp','.h']
|
|
|
|
# testFormat: The test format to use to interpret tests.
|
|
config.test_format = lit.formats.ShTest()
|
|
|
|
# test_source_root: The root path where tests are located.
|
|
config.test_source_root = os.path.dirname(__file__)
|
|
|
|
config.excludes = ['cmdparser.hpp']
|
|
|
|
# test_exec_root: The path where tests are located (default is the test suite root).
|
|
#config.test_exec_root = config.test_source_root
|
|
|
|
# target_triple: Used by ShTest and TclTest formats for XFAIL checks.
|
|
config.target_triple = '(unused)'
|
|
|
|
# available_features: Used by ShTest and TclTest formats for REQUIRES checks.
|
|
config.available_features = []
|
|
|
|
site_cfg = lit_config.params.get('site_config', None)
|
|
lit_config.load_config(config, site_cfg)
|
|
|
|
obj_root = getattr(config, 'obj_root', None)
|
|
if obj_root is not None:
|
|
config.test_exec_root = obj_root
|
|
|
|
if obj_root is not None:
|
|
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
|
|
if not llvm_tools_dir:
|
|
lit_config.fatal('No LLVM tools dir set!')
|
|
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
|
|
config.environment['PATH'] = path
|
|
|
|
hipify_path = obj_root
|
|
clang_args = "-x cuda -v --cuda-gpu-arch=sm_30 --cuda-path='%s'"
|
|
|
|
if sys.platform in ['win32']:
|
|
run_test_ext = ".bat"
|
|
hipify_path += "/" + config.build_type
|
|
clang_args += " -isystem'%s'/common/inc -std=c++14"
|
|
else:
|
|
run_test_ext = ".sh"
|
|
clang_args += " -isystem'%s'/samples/common/inc"
|
|
|
|
clang_args += " -I'%s'/include"
|
|
|
|
config.substitutions.append(("%cuda_args", clang_args % (config.cuda_root, config.cuda_sdk_root, config.cuda_dnn_root)))
|
|
config.substitutions.append(("hipify", '"' + hipify_path + "/hipify-clang" + '"'))
|
|
config.substitutions.append(("%run_test", '"' + config.test_source_root + "/run_test" + run_test_ext + '"'))
|