Skip to content

Commit

Permalink
Avoid calling chess directly (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenneuendorffer authored Oct 1, 2024
1 parent 771ad3c commit 3e6c732
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 8 additions & 6 deletions aie_runtime_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ function(add_aie_runtime_libs arch)
if(DEFINED VITIS_ROOT)
add_custom_target(${arch}_chess_intrinsic_wrapper ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/chess_intrinsic_wrapper.ll)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chess_intrinsic_wrapper.ll
COMMAND ${VITIS_XCHESSCC} -p me -P ${VITIS_${arch}_INCLUDE_DIR}
-C Release_LLVM
-I ${VITIS_${arch}_INCLUDE_DIR}/runtime/include/
-d -c ${CMAKE_CURRENT_SOURCE_DIR}/chess_intrinsic_wrapper.cpp
-f +f
COMMAND ${PROJECT_BINARY_DIR}/bin/xchesscc_wrapper ${arch}
-c ${CMAKE_CURRENT_SOURCE_DIR}/chess_intrinsic_wrapper.cpp
-d # Disassemble output
-f # Use LLVM frontend
+f # ... and emit LLVMIR
-o ${CMAKE_CURRENT_BINARY_DIR}/chess_intrinsic_wrapper.ll
COMMAND sed -i s/^target.*//
${CMAKE_CURRENT_BINARY_DIR}/chess_intrinsic_wrapper.ll
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/chess_intrinsic_wrapper.cpp)
DEPENDS
xchesscc_wrapper
${CMAKE_CURRENT_SOURCE_DIR}/chess_intrinsic_wrapper.cpp)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/chess_intrinsic_wrapper.ll DESTINATION ${CMAKE_INSTALL_PREFIX}/aie_runtime_lib/${arch})
add_dependencies(aie-runtime-libs ${arch}_chess_intrinsic_wrapper)
endif()
Expand Down
7 changes: 6 additions & 1 deletion tools/chess-clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
if(NOT DEFINED CMAKE_CROSSCOMPILE)
set(SCRIPT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/bin)
# These files are only useful on host x86 compiles.
install(PROGRAMS xchesscc_wrapper DESTINATION ${PROJECT_BINARY_DIR}/bin)
add_custom_target(xchesscc_wrapper
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/xchesscc_wrapper
${PROJECT_BINARY_DIR}/bin/xchesscc_wrapper
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/xchesscc_wrapper)
install(PROGRAMS xchesscc_wrapper DESTINATION ${SCRIPT_INSTALL_PATH})
endif()

0 comments on commit 3e6c732

Please sign in to comment.