Exemple #1
0
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', 'lit.cfg.py',
    'lit.local.cfg.py'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.circt_obj_root, 'integration_test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
# Substitute '%l' with the path to the build lib dir.

# Tweak the PYTHONPATH to include the binary dir.
if config.bindings_python_enabled:
    llvm_config.with_environment(
        'PYTHONPATH',
        [os.path.join(config.circt_python_packages_dir, 'circt_core')],
        append_path=True)

tool_dirs = [
    config.circt_tools_dir, config.circt_utils_dir, config.mlir_tools_dir,
    config.llvm_tools_dir
]
tools = [
    'circt-opt', 'circt-translate', 'firtool', 'circt-rtl-sim.py',
Exemple #2
0
    "LICENSE.txt",
    "networks",
    "test_fuse_cast_scale.mlir.py",
    "test_util.py",
    "test_mlir_opt.mlir.py",
    "lit.cfg.py",
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.oneflow_obj_root, "test")
config.oneflow_tools_dir = os.path.join(config.oneflow_ir_obj_root, "bin")

# Tweak the PATH to include the tools dir.
llvm_config.with_environment("PATH", config.llvm_tools_dir, append_path=True)
llvm_config.with_environment("ONEFLOW_MLIR_STDOUT", "1")
llvm_config.with_environment("ONEFLOW_MLIR_ENABLE_CODEGEN_FUSERS", "1")
llvm_config.with_environment("ONEFLOW_MLIR_ENABLE_ROUND_TRIP", "1")
llvm_config.with_environment(
    "PYTHONPATH", os.path.join(config.oneflow_src_root, "python"), append_path=True,
)

tool_dirs = [config.oneflow_tools_dir, config.llvm_tools_dir]
tools = ["oneflow-opt", "oneflow-translate"]
tools.extend(
    [ToolSubst("%linalg_test_lib_dir", config.llvm_lib_dir, unresolved="ignore"),]
)
llvm_config.add_tool_substitutions(tools, tool_dirs)
Exemple #3
0
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', 'lit.cfg.py',
    'lit.site.cfg.py'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.mlir_obj_root, 'test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir]
tools = [
    'mlir-opt',
    'mlir-tblgen',
    'mlir-translate',
    'mlir-capi-ir-test',
    'mlir-capi-pass-test',
    'mlir-edsc-builder-api-test',
    'mlir-cpu-runner',
    'mlir-linalg-ods-gen',
    'mlir-reduce',
    'mlir-sdbm-api-test',
]
Exemple #4
0
    return attr_value


# If this is an MSVC environment, the tests at the root of the tree are
# unsupported. The local win_cdb test suite, however, is supported.
is_msvc = get_required_attr(config, "is_msvc")
if is_msvc:
    config.available_features.add('msvc')
    # FIXME: We should add some llvm lit utility code to find the Windows SDK
    # and set up the environment appopriately.
    win_sdk = 'C:/Program Files (x86)/Windows Kits/10/'
    arch = 'x64'
    llvm_config.with_system_environment(['LIB', 'LIBPATH', 'INCLUDE'])
    # Clear _NT_SYMBOL_PATH to prevent cdb from attempting to load symbols from
    # the network.
    llvm_config.with_environment('_NT_SYMBOL_PATH', '')
    tools.append(
        ToolSubst('%cdb', '"%s"' %
                  os.path.join(win_sdk, 'Debuggers', arch, 'cdb.exe')))

# clang_src_dir is not used by these tests, but is required by
# use_clang(), so set it to "".
if not hasattr(config, 'clang_src_dir'):
    config.clang_src_dir = ""
llvm_config.use_clang()

if config.llvm_use_sanitizer:
    # Propagate path to symbolizer for ASan/MSan.
    llvm_config.with_system_environment(
        ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
Exemple #5
0
# by individual lit.local.cfg files in the test subdirectories.
config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s', '.mir']

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.llvm_obj_root, 'test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

# Propagate some variables from the host environment.
llvm_config.with_system_environment(
    ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])


# Set up OCAMLPATH to include newly built OCaml libraries.
top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml')
llvm_ocaml_lib = os.path.join(top_ocaml_lib, 'llvm')

llvm_config.with_system_environment('OCAMLPATH')
llvm_config.with_environment('OCAMLPATH', top_ocaml_lib, append_path=True)
llvm_config.with_environment('OCAMLPATH', llvm_ocaml_lib, append_path=True)

llvm_config.with_system_environment('CAML_LD_LIBRARY_PATH')
Exemple #6
0
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', 'lit.cfg.py',
    'lit.local.cfg.py'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.circt_obj_root,
                                     'frontends/pycde/test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = [
    config.circt_tools_dir, config.mlir_tools_dir, config.llvm_tools_dir
]
tools = ['py-split-input-file.py']

llvm_config.add_tool_substitutions(tools, tool_dirs)

# Tweak the PYTHONPATH to include the binary dir.
llvm_config.with_environment('PYTHONPATH', [
    os.path.join(config.circt_python_packages_dir, 'circt_core'),
    os.path.join(config.circt_python_packages_dir, 'pycde')
],
                             append_path=True)
Exemple #7
0
    return attr_value


# If this is an MSVC environment, the tests at the root of the tree are
# unsupported. The local win_cdb test suite, however, is supported.
is_msvc = get_required_attr(config, "is_msvc")
if is_msvc:
    # FIXME: We should add some llvm lit utility code to find the Windows SDK
    # and set up the environment appopriately.
    win_sdk = 'C:/Program Files (x86)/Windows Kits/10/'
    arch = 'x64'
    config.unsupported = True
    llvm_config.with_system_environment(['LIB', 'LIBPATH', 'INCLUDE'])
    # Clear _NT_SYMBOL_PATH to prevent cdb from attempting to load symbols from
    # the network.
    llvm_config.with_environment('_NT_SYMBOL_PATH', '')
    tools.append(
        ToolSubst('%cdb', '"%s"' %
                  os.path.join(win_sdk, 'Debuggers', arch, 'cdb.exe')))

llvm_config.use_default_substitutions()

# clang_src_dir is not used by these tests, but is required by
# use_clang(), so set it to "".
if not hasattr(config, 'clang_src_dir'):
    config.clang_src_dir = ""
llvm_config.use_clang()

if config.llvm_use_sanitizer:
    # Propagate path to symbolizer for ASan/MSan.
    llvm_config.with_system_environment(
Exemple #8
0
llvm_config.use_default_substitutions()

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt',
                   'lit.cfg.py', 'lit.site.cfg.py']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.mlir_obj_root, 'test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.mlir_tools_dir, append_path=True)
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir]
tools = [
    'mlir-opt',
    'mlir-tblgen',
    'mlir-translate',
    'mlir-lsp-server',
    'mlir-capi-execution-engine-test',
    'mlir-capi-ir-test',
    'mlir-capi-llvm-test',
    'mlir-capi-pass-test',
    'mlir-capi-sparse-tensor-test',
    'mlir-capi-quant-test',
    'mlir-capi-pdl-test',
Exemple #9
0
import os

import lit.util
import lit.formats
from lit.llvm import llvm_config

config.name = 'JitFromScratch'

config.test_format = lit.formats.ShTest()
config.test_source_root = os.path.dirname(__file__)
config.suffixes = ['.test']

if config.build_type.lower() == "debug":
    config.suffixes.append('.test-debug')

# Add binary directories for JitFromScratch and FileCheck executables
llvm_config.with_environment('PATH',
                             config.jitfromscratch_build_dir,
                             append_path=True)
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
Exemple #10
0
    'COMPILER_PATH', 'RC_DEBUG_OPTIONS', 'CINDEXTEST_PREAMBLE_FILE',
    'LIBRARY_PATH', 'CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH',
    'OBJC_INCLUDE_PATH', 'OBJCPLUS_INCLUDE_PATH', 'LIBCLANG_TIMING',
    'LIBCLANG_OBJTRACKING', 'LIBCLANG_LOGGING', 'LIBCLANG_BGPRIO_INDEX',
    'LIBCLANG_BGPRIO_EDIT', 'LIBCLANG_NOTHREADS', 'LIBCLANG_RESOURCE_USAGE',
    'LIBCLANG_CODE_COMPLETION_LOGGING'
]
# Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it.
if platform.system() != 'Windows':
    possibly_dangerous_env_vars.append('INCLUDE')

llvm_config.clear_environment(possibly_dangerous_env_vars)

# Tweak the PATH to include the tools dir and the scripts dir.
llvm_config.with_environment('PATH',
                             [config.llvm_tools_dir, config.clang_tools_dir],
                             append_path=True)

llvm_config.with_environment('LD_LIBRARY_PATH',
                             [config.llvm_shlib_dir, config.llvm_libs_dir],
                             append_path=True)

# Propagate path to symbolizer for ASan/MSan.
llvm_config.with_system_environment(
    ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])

# Discover the 'clang' and 'clangcc' to use.


def inferClang(PATH):
    # Determine which clang to use.
Exemple #11
0
llvm_config.use_default_substitutions()

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.mlir_obj_root, 'test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

from pathlib import Path

llvm_config.with_environment('ARC_CARGO', 'arc-cargo')

tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir,
             config.arcscript_tools_dir]
tools = [
    'mlir-opt',
    'mlir-tblgen',
    'mlir-translate',
    'arc-mlir',
    'arc-lang',
    'arc',
]
Exemple #12
0
llvm_config.use_default_substitutions()

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'lit.cfg.py', 'Inputs', 'Examples', 'CMakeLists.txt', 'README.txt',
    'LICENSE.txt'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.torch_mlir_obj_root, 'test')
config.torch_mlir_tools_dir = os.path.join(config.torch_mlir_obj_root, 'bin')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
llvm_config.with_environment('PYTHONPATH', [
    os.path.join(config.torch_mlir_python_packages_dir, 'torch_mlir'),
],
                             append_path=True)

tool_dirs = [config.torch_mlir_tools_dir, config.llvm_tools_dir]
tools = [
    'torch-mlir-opt',
]

llvm_config.add_tool_substitutions(tools, tool_dirs)
Exemple #13
0
                               'CINDEXTEST_PREAMBLE_FILE', 'LIBRARY_PATH',
                               'CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH',
                               'OBJC_INCLUDE_PATH', 'OBJCPLUS_INCLUDE_PATH',
                               'LIBCLANG_TIMING', 'LIBCLANG_OBJTRACKING',
                               'LIBCLANG_LOGGING', 'LIBCLANG_BGPRIO_INDEX',
                               'LIBCLANG_BGPRIO_EDIT', 'LIBCLANG_NOTHREADS',
                               'LIBCLANG_RESOURCE_USAGE',
                               'LIBCLANG_CODE_COMPLETION_LOGGING']
# Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it.
if platform.system() != 'Windows':
    possibly_dangerous_env_vars.append('INCLUDE')

llvm_config.clear_environment(possibly_dangerous_env_vars)

# Tweak the PATH to include the tools dir and the scripts dir.
llvm_config.with_environment(
    'PATH', [config.llvm_tools_dir, config.clang_tools_dir], append_path=True)

llvm_config.with_environment('LD_LIBRARY_PATH', [
                             config.llvm_shlib_dir, config.llvm_libs_dir], append_path=True)

# Propagate path to symbolizer for ASan/MSan.
llvm_config.with_system_environment(
    ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])

llvm_config.use_default_substitutions()

# Discover the 'clang' and 'clangcc' to use.


def inferClang(PATH):
    # Determine which clang to use.
Exemple #14
0
]
# Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it.
if platform.system() != 'Windows':
    possibly_dangerous_env_vars.append('INCLUDE')

for name in possibly_dangerous_env_vars:
    if name in llvm_config.config.environment:
        del llvm_config.config.environment[name]

# Propagate some variables from the host environment.
llvm_config.with_system_environment([
    'PATH', 'OCL_ICD_FILENAMES', 'CL_CONFIG_DEVICES', 'SYCL_DEVICE_ALLOWLIST',
    'SYCL_CONFIG_FILE_NAME'
])

llvm_config.with_environment('PATH', config.lit_tools_dir, append_path=True)

# Configure LD_LIBRARY_PATH or corresponding os-specific alternatives
if platform.system() == "Linux":
    config.available_features.add('linux')
    llvm_config.with_system_environment(
        ['LD_LIBRARY_PATH', 'LIBRARY_PATH', 'CPATH'])
    llvm_config.with_environment('LD_LIBRARY_PATH',
                                 config.sycl_libs_dir,
                                 append_path=True)

elif platform.system() == "Windows":
    config.available_features.add('windows')
    llvm_config.with_system_environment(['LIB', 'CPATH', 'INCLUDE'])
    llvm_config.with_environment('LIB', config.sycl_libs_dir, append_path=True)
    llvm_config.with_environment('PATH',
Exemple #15
0
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'lit.cfg.py', 'Inputs', 'Examples', 'CMakeLists.txt', 'README.txt',
    'LICENSE.txt'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.npcomp_obj_root, 'test')
config.npcomp_tools_dir = os.path.join(config.npcomp_obj_root, 'bin')

# Tweak the PATH to include the tools dir.
npcomp_python_dir = "python" if config.npcomp_built_standalone else "tools/npcomp/python"
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
llvm_config.with_environment('PYTHONPATH', [
    os.path.join(config.npcomp_python_packages_dir, 'npcomp_core'),
    os.path.join(config.npcomp_python_packages_dir, 'npcomp_torch')
],
                             append_path=True)

tool_dirs = [config.npcomp_tools_dir, config.llvm_tools_dir]
tools = [
    'npcomp-opt',
]

llvm_config.add_tool_substitutions(tools, tool_dirs)
Exemple #16
0
# -*- Python -*-

# Configuration file for the 'lit' test runner.

import os
import sys

import lit.formats
from lit.llvm import llvm_config

# name: The name of this test suite.
config.name = 'lldb-Unit'

# suffixes: A list of file extensions to treat as test files.
config.suffixes =  []

# test_source_root: The root path where unit test binaries are located.
# test_exec_root: The root path where tests should be run.
config.test_source_root = os.path.join(config.lldb_obj_root, 'unittests')
config.test_exec_root = config.test_source_root

# One of our unit tests dynamically links against python.dll, and on Windows
# it needs to be able to find it at runtime.  This is fine if Python is on your
# system PATH, but if it's not, then this unit test executable will fail to run.
# We can solve this by forcing the Python directory onto the system path here.
llvm_config.with_system_environment('PATH')
llvm_config.with_environment('PATH', os.path.dirname(sys.executable), append_path=True)

# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
Exemple #17
0
# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)

# suffixes: A list of file extensions to treat as test files. This is overridden
# by individual lit.local.cfg files in the test subdirectories.
config.suffixes = ['.amber']

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = []

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.llvm_obj_root, 'test')

# Set features for available gpu hardware. They can be queried with REQUIRES, etc.
for gfxip in query_gfxips():
    config.available_features.add(gfxip)

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
llvm_config.with_environment('PATH', config.test_source_root, append_path=True)
# Contains the path for vulkan validation layers
llvm_config.with_system_environment('XDG_DATA_DIRS')

llvm_config.use_default_substitutions()
Exemple #18
0
llvm_config.use_default_substitutions()

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'Inputs', 'Examples', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'
]

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.standalone_obj_root, 'test')
config.standalone_tools_dir = os.path.join(config.standalone_obj_root, 'bin')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = [config.standalone_tools_dir, config.llvm_tools_dir]
tools = [
    'standalone-capi-test',
    'standalone-opt',
    'standalone-translate',
    ToolSubst('%PYTHON', config.python_executable, unresolved='ignore'),
]

llvm_config.add_tool_substitutions(tools, tool_dirs)

llvm_config.with_environment('PYTHONPATH', [
    os.path.join(config.mlir_binary_dir, 'python_packages', 'standalone'),
],
                             append_path=True)
Exemple #19
0
    "networks",
    "test_fuse_cast_scale.mlir.py",
    "test_util.py",
    "test_mlir_opt.mlir.py",
    "lit.cfg.py",
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.oneflow_obj_root, "test")
config.oneflow_tools_dir = os.path.join(config.oneflow_ir_obj_root, "bin")

# Tweak the PATH to include the tools dir.
llvm_config.with_environment("PATH", config.llvm_tools_dir, append_path=True)

# TODO: these two should be unnecessary
llvm_config.with_environment(
    "LD_LIBRARY_PATH",
    os.path.join(config.oneflow_obj_root, "third_party_install/protobuf/lib"),
    append_path=True,
)
llvm_config.with_environment(
    "LD_LIBRARY_PATH",
    os.path.join(config.oneflow_obj_root, "_deps/glog-build"),
    append_path=True,
)

llvm_config.with_environment("ONEFLOW_MLIR_STDOUT", "1")
llvm_config.with_environment("ONEFLOW_MLIR_ENABLE_CODEGEN_FUSERS", "1")
    ])

llvm_config.add_tool_substitutions(tools, tool_dirs)

using_spirv_tools = False

if config.spirv_tools_have_spirv_as:
    llvm_config.add_tool_substitutions(['spirv-as'],
                                       [config.spirv_tools_bin_dir])
    config.available_features.add('spirv-as')
    using_spirv_tools = True

if config.spirv_tools_have_spirv_link:
    llvm_config.add_tool_substitutions(['spirv-link'],
                                       [config.spirv_tools_bin_dir])
    config.available_features.add('spirv-link')
    using_spirv_tools = True

if config.spirv_tools_have_spirv_val:
    llvm_config.add_tool_substitutions(['spirv-val'],
                                       [config.spirv_tools_bin_dir])
    using_spirv_tools = True
else:
    config.substitutions.append(('spirv-val', ':'))

if using_spirv_tools:
    llvm_config.with_system_environment('LD_LIBRARY_PATH')
    llvm_config.with_environment('LD_LIBRARY_PATH',
                                 config.spirv_tools_lib_dir,
                                 append_path=True)
Exemple #21
0
# override from the environment.
if PYTHON_EXEC is None:
    PYTHON_EXEC = os.getenv("PYTHON")

config.substitutions.extend([
    ("%PYTHON", PYTHON_EXEC),
])

# Add our local projects to the PYTHONPATH
python_projects_dir = os.path.join(os.path.dirname(__file__), "..",
                                   "python_projects")
test_src_dir = os.path.join(os.path.dirname(__file__), "python")
llvm_config.with_environment("PYTHONPATH", [
    test_src_dir,
    os.path.join(python_projects_dir, "iree_tf"),
    os.path.join(python_projects_dir, "iree_tflite"),
    os.path.join(python_projects_dir, "iree_xla"),
],
                             append_path=True)

# Enable features based on -D FEATURES=hugetest,vulkan
# syntax.
# We always allow "llvmaot". It can be disabled with -D DISABLE_FEATURES=llvmaot
disable_features_param = lit_config.params.get("DISABLE_FEATURES")
disable_features = []
if disable_features_param:
    disable_features = disable_features_param.split(",")
if "llvmaot" not in disable_features:
    config.available_features.add("llvmaot")
features_param = lit_config.params.get("FEATURES")
if features_param:
Exemple #22
0
# directories.
config.excludes = [
    'Inputs', 'Examples', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt',
    'lit.cfg.py', 'lit.site.cfg.py'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.iree_dialects_obj_root, 'test')
config.standalone_tools_dir = os.path.join(config.iree_dialects_obj_root,
                                           'bin')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = [config.llvm_tools_dir]
tools = [
    ToolSubst('%PYTHON', config.python_executable, unresolved='ignore'),
]

llvm_config.add_tool_substitutions(tools, tool_dirs)

if config.enable_bindings_python:
    llvm_config.with_environment('PYTHONPATH', [
        os.path.join(config.iree_dialects_obj_root, 'python_packages',
                     'iree_dialects'),
    ],
                                 append_path=True)
Exemple #23
0
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.bolt_obj_root, 'test')

llvm_config.use_default_substitutions()

tool_dirs = [config.llvm_tools_dir]
tools = [
    ToolSubst('llvm-bolt', unresolved='fatal'),
]
llvm_config.add_tool_substitutions([], tool_dirs)
llvm_config.with_environment('PATH', tool_dirs, append_path=True)

# Propagate path to symbolizer for ASan/MSan.
llvm_config.with_system_environment(
    ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])

config.substitutions.append(('%PATH%', config.environment['PATH']))

# Plugins (loadable modules)
# TODO: This should be supplied by Makefile or autoconf.
if sys.platform in ['win32', 'cygwin']:
    has_plugins = config.enable_shared
else:
    has_plugins = True

if has_plugins and config.llvm_plugin_ext:
Exemple #24
0
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = [
    'Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', 'lit.cfg.py',
    'lit.site.cfg.py'
]

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.mlir_obj_root, 'test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = [config.mlir_tools_dir, config.llvm_tools_dir]
tools = [
    'mlir-opt',
    'mlir-tblgen',
    'mlir-translate',
    'mlir-capi-ir-test',
    'mlir-edsc-builder-api-test',
]

# The following tools are optional
tools.extend([
    ToolSubst('%PYTHON', config.python_executable),
    ToolSubst('toy-ch1', unresolved='ignore'),
    ToolSubst('toy-ch2', unresolved='ignore'),
Exemple #25
0
if config.timeout is not None and config.timeout != "":
    lit_config.maxIndividualTestTime = int(config.timeout)

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.circt_obj_root, 'integration_test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
# Substitute '%l' with the path to the build lib dir.

tool_dirs = [
    config.circt_tools_dir, config.mlir_tools_dir, config.llvm_tools_dir
]
tools = [
    'circt-opt', 'circt-translate', 'firtool', 'circt-rtl-sim.py',
    'esi-cosim-runner.py'
]

# Enable yosys if it has been detected.
if config.yosys_path != "":
    tool_dirs.append(os.path.dirname(config.yosys_path))
    tools.append('yosys')
    config.available_features.add('yosys')
        #  Handle these specially as they are strings searched for during testing.
        ToolSubst('count.exe', unresolved='fatal'),
        ToolSubst('not.exe', unresolved='fatal')
    ]

    llvm_config.config.substitutions.append(
        ('%python', '"%s"' % (sys.executable)))

    llvm_config.add_tool_substitutions(tool_patterns,
                                       [llvm_config.config.llvm_tools_dir])
else:
    llvm_config.use_default_substitutions()

llvm_config.config.substitutions.append(
    ('%tfrt_bindir', 'tensorflow/compiler/aot'))

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

tool_dirs = config.mlir_tf_tools_dirs + [
    config.mlir_tools_dir, config.llvm_tools_dir
]
tool_names = [
    'mlir-opt', 'mlir-translate', 'tf-opt', 'tf_tfl_translate',
    'flatbuffer_to_string', 'flatbuffer_translate', 'tf-mlir-translate',
    'mlir-tflite-runner', 'tfcompile', 'json_to_flatbuffer'
]
tools = [ToolSubst(s, unresolved='ignore') for s in tool_names]
llvm_config.add_tool_substitutions(tools, tool_dirs)
# pylint: enable=undefined-variable
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['lit.cfg.py', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.npcomp_obj_root, 'test')
config.npcomp_tools_dir = os.path.join(config.npcomp_obj_root, 'tools')
config.npcomp_runtime_shlib = os.path.join(
    config.npcomp_obj_root, 'lib', 'runtime',
    'libNPCOMPCompilerRuntimeShlib' + config.llvm_shlib_ext)

# Tweak the PATH and PYTHONPATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
llvm_config.with_environment('PYTHONPATH',
                             [os.path.join(config.npcomp_obj_root, "python")],
                             append_path=True)

tool_dirs = [
    os.path.join(config.npcomp_tools_dir, 'npcomp-opt'),
    os.path.join(config.npcomp_tools_dir, 'npcomp-run-mlir'),
    config.llvm_tools_dir,
]
tools = [
    'npcomp-opt',
    'npcomp-run-mlir',
    ToolSubst('%npcomp_runtime_shlib', config.npcomp_runtime_shlib),
]
Exemple #28
0
# by individual lit.local.cfg files in the test subdirectories.
config.suffixes = ['.ll', '.c', '.test', '.txt', '.s', '.mir', '.yaml']

# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.llvm_obj_root, 'test')

# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)

# Propagate some variables from the host environment.
llvm_config.with_system_environment([
    'HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH',
    'MSAN_SYMBOLIZER_PATH'
])

# Set up OCAMLPATH to include newly built OCaml libraries.
top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml')
llvm_ocaml_lib = os.path.join(top_ocaml_lib, 'llvm')

llvm_config.with_system_environment('OCAMLPATH')
llvm_config.with_environment('OCAMLPATH', top_ocaml_lib, append_path=True)
llvm_config.with_environment('OCAMLPATH', llvm_ocaml_lib, append_path=True)
import os

import lit.util
import lit.formats
from lit.llvm import llvm_config

config.name = 'JitFromScratch'

config.test_format = lit.formats.ShTest()
config.test_source_root = os.path.dirname(__file__)
config.suffixes = ['.test']

if config.build_type.lower() == "debug":
  config.suffixes.append('.test-debug')

# Add binary directories for JitFromScratch and FileCheck executables
llvm_config.with_environment('PATH', config.jitfromscratch_build_dir, append_path=True)
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)