Skip to content

Commit

Permalink
Copy triton-translate to triton_BINARY_DIR/bin folder instead of …
Browse files Browse the repository at this point in the history
…modifying lit config file (#2965)

Part of #2030

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev authored Dec 9, 2024
1 parent 45d3226 commit a6f0f80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@
# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.triton_obj_root, 'test')
config.triton_tools_dir = os.path.join(config.triton_obj_root, 'bin')
config.triton_intel_plugin_tools_dir = os.path.join(config.triton_obj_root, 'third_party', 'intel', 'bin')
config.filecheck_dir = os.path.join(config.triton_obj_root, 'bin', 'FileCheck')

# FileCheck -enable-var-scope is enabled by default in MLIR test
# This option avoids to accidentally reuse variable across -LABEL match,
# it can be explicitly opted-in by prefixing the variable name with $
config.environment["FILECHECK_OPTS"] = "--enable-var-scope"

tool_dirs = [config.triton_tools_dir, config.triton_intel_plugin_tools_dir, config.llvm_tools_dir, config.filecheck_dir]
tool_dirs = [config.triton_tools_dir, config.llvm_tools_dir, config.filecheck_dir]

# Tweak the PATH to include the tools dir.
for d in tool_dirs:
Expand Down
7 changes: 7 additions & 0 deletions third_party/intel/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ target_link_libraries(triton-translate
TritonGENToLLVMIRTranslation
)
mlir_check_link_libraries(triton-translate)

# Move `triton-translate` to the folder where `lit` expects to find it
add_custom_command(TARGET triton-translate POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
"$<TARGET_FILE:triton-translate>"
"${triton_BINARY_DIR}/bin"
)

0 comments on commit a6f0f80

Please sign in to comment.