Files
rocm-systems/tests/hipify-clang/lit.site.cfg.in
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

37 lines
1.5 KiB
Plaintext

import sys
import os
config.pointer_size = @CMAKE_SIZEOF_VOID_P@
config.llvm_version = "@LLVM_PACKAGE_VERSION@"
config.llvm_tools_dir = "@LLVM_TOOLS_BINARY_DIR@"
config.obj_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.cuda_root = "@CUDA_TOOLKIT_ROOT_DIR@"
config.cuda_dnn_root = "@CUDA_DNN_ROOT_DIR@"
config.cuda_version_major = int("@CUDA_VERSION_MAJOR@")
config.cuda_version_minor = int("@CUDA_VERSION_MINOR@")
config.cuda_version = "@CUDA_VERSION@"
if sys.platform in ['win32']:
config.cuda_sdk_root = "@CUDA_SDK_ROOT_DIR@"
if not config.cuda_sdk_root or config.cuda_sdk_root == "CUDA_SDK_ROOT_DIR-NOTFOUND":
cuda_version = config.cuda_version
cuda_version = cuda_version.replace('.','_')
config.cuda_samples_root = os.environ.get('NVCUDASAMPLES' + cuda_version + '_ROOT')
if not config.cuda_samples_root:
lit_config.fatal('No CUDA Samples dir set! Please set CUDA_SDK_ROOT_DIR.')
config.cuda_sdk_root = config.cuda_samples_root
config.build_type = "@CMAKE_BUILD_TYPE@"
if not config.build_type:
config.build_type = "Debug"
else:
config.cuda_sdk_root = config.cuda_root
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
try:
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
config.obj_root = config.obj_root % lit_config.params
except KeyError:
e = sys.exc_info()[1]
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))