Files
rocm-systems/tests/hipify-clang/lit.cfg
T
Evgeny Mankov e899ee0e06 [HIPIFY][tests] Update lit testing infrastructure
+ Set -D__LP64__ in case of 64-bit hipify-clang binary
  [partial workaround for clang's bug https://bugs.llvm.org/show_bug.cgi?id=38811]

  C:/GIT/LLVM/trunk/llvm-64-release-vs2017/dist/lib/clang/9.0.0\include\__clang_cuda_device_functions.h(1609,45): error GEF7559A7: no matching function for call to 'roundf'
  __DEVICE__ long lroundf(float __a) { return roundf(__a); }

  #if defined(__LP64__)
  __DEVICE__ long lround(double __a) { return llround(__a); }
  __DEVICE__ long lroundf(float __a) { return llroundf(__a); } // ok: llroundf should be used when 64-bit
  #else
  __DEVICE__ long lround(double __a) { return round(__a); }
  __DEVICE__ long lroundf(float __a) { return roundf(__a); } // error
  #endif

+ Print more system info while testing in the following form:
  ========================================
  CUDA 9.0 - will be used for testing
  LLVM 9.0.0svn - will be used for testing
  AMD64 - Platform architecture
  Windows 10 - Platform OS
  64 - hipify-clang binary bitness
  32 - python 3.7.2 binary bitness
  ========================================
2019-03-06 19:26:05 +03:00

97 rader
3.5 KiB
INI

# -*- Python -*-
import os
import platform
import re
import subprocess
import struct
import lit.formats
import lit.util
# Configuration file for the 'lit' test runner.
site_cfg = lit_config.params.get('site_config', None)
lit_config.load_config(config, site_cfg)
print(str("========================================"))
print("CUDA " + config.cuda_version + " - will be used for testing")
print("LLVM " + config.llvm_version + " - will be used for testing")
print(platform.machine() + " - Platform architecture")
print(platform.system() + " " + platform.release() + " - Platform OS")
print(str(config.pointer_size * 8) + " - hipify-clang binary bitness")
print(str(struct.calcsize("P") * 8) + " - python " + str(platform.python_version()) + " binary bitness")
print(str("========================================"))
config.excludes = ['cmdparser.hpp']
config.excludes.append('spatial_batch_norm_op.h')
config.excludes.append('common_cudnn.h')
if config.cuda_version_major == 7 and config.cuda_version_minor == 0:
config.excludes.append('headers_test_09.cu')
config.excludes.append('cudnn_convolution_forward.cu')
if config.cuda_version_major < 8:
config.excludes.append('cuSPARSE_02.cu')
if config.cuda_version_major < 9:
config.excludes.append('cuSPARSE_04.cu')
config.excludes.append('cuSPARSE_05.cu')
config.excludes.append('cuSPARSE_06.cu')
config.excludes.append('cuSPARSE_07.cu')
config.excludes.append('benchmark_curand_kernel.cpp')
if config.cuda_version_major < 10:
config.excludes.append('cuSPARSE_08.cu')
config.excludes.append('cuSPARSE_09.cu')
config.excludes.append('cuSPARSE_10.cu')
config.excludes.append('cuSPARSE_11.cu')
# 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__)
# 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 = []
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_arguments = "-v"
if sys.platform in ['win32']:
run_test_ext = ".bat"
hipify_path += "/" + config.build_type
clang_arguments += " -isystem'%s'/common/inc"
else:
run_test_ext = ".sh"
clang_arguments += " -isystem'%s'/samples/common/inc"
clang_arguments += " -I'%s'/include"
if config.pointer_size == 8:
clang_arguments += " -D__LP64__"
hipify_arguments = "--cuda-path='%s'"
config.substitutions.append(("%clang_args", clang_arguments % (config.cuda_sdk_root, config.cuda_dnn_root)))
config.substitutions.append(("%hipify_args", hipify_arguments % (config.cuda_root)))
config.substitutions.append(("hipify", '"' + hipify_path + "/hipify-clang" + '"'))
config.substitutions.append(("%run_test", '"' + config.test_source_root + "/run_test" + run_test_ext + '"'))