CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
97 lines
3.1 KiB
CMake
97 lines
3.1 KiB
CMake
# Copyright Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
# Intrinsic Compiler Tool
|
|
#
|
|
# This tool compiles intrinsic definitions (.intrinsic) to optimized bitcode (.st.bc)
|
|
# It runs AFTER the main library is built, so it can link against libstinkytofu.
|
|
|
|
set(SOURCES
|
|
intrinsic-compiler.cpp
|
|
)
|
|
|
|
add_executable(intrinsic-compiler "${SOURCES}")
|
|
target_link_libraries(intrinsic-compiler PRIVATE stinkytofu-warnings)
|
|
|
|
# Link against the main stinkytofu library (for CodeGenerator, passes, etc.)
|
|
target_link_libraries(intrinsic-compiler PRIVATE stinkytofu)
|
|
|
|
target_include_directories(intrinsic-compiler PRIVATE
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../include"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../src/serialization/asm"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../hardware/include"
|
|
"${PROJECT_BINARY_DIR}" # For generated files like hardware/gfxIsa.inc
|
|
"${PROJECT_BINARY_DIR}/include" # For other generated files
|
|
)
|
|
|
|
# Custom command to compile intrinsics to .st.bc
|
|
# This runs AFTER the main library is built
|
|
set(INTRINSIC_DEF_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../src/ir/logical/Intrinsics.intrinsic")
|
|
set(INTRINSIC_BC_FILE "${CMAKE_BINARY_DIR}/intrinsics.st.bc")
|
|
|
|
add_custom_command(
|
|
OUTPUT "${INTRINSIC_BC_FILE}"
|
|
COMMAND $<TARGET_FILE:intrinsic-compiler> "${INTRINSIC_DEF_FILE}" "${INTRINSIC_BC_FILE}"
|
|
DEPENDS intrinsic-compiler "${INTRINSIC_DEF_FILE}"
|
|
COMMENT "Compiling intrinsics to ${INTRINSIC_BC_FILE}..."
|
|
VERBATIM
|
|
)
|
|
|
|
# Custom target for intrinsic compilation
|
|
add_custom_target(intrinsics_compiled
|
|
DEPENDS "${INTRINSIC_BC_FILE}"
|
|
COMMENT "Compile intrinsic patterns"
|
|
)
|
|
|
|
# Install the intrinsic-compiler tool
|
|
install(TARGETS intrinsic-compiler
|
|
RUNTIME DESTINATION bin
|
|
COMPONENT tools)
|
|
|
|
# Install the .st.bc file
|
|
install(FILES "${INTRINSIC_BC_FILE}"
|
|
DESTINATION lib
|
|
COMPONENT runtime)
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
# Test Loader Program
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
set(TEST_LOADER_SOURCES
|
|
test_loader.cpp
|
|
)
|
|
|
|
add_executable(test_loader "${TEST_LOADER_SOURCES}")
|
|
target_link_libraries(test_loader PRIVATE stinkytofu-warnings)
|
|
|
|
# Link against the main stinkytofu library
|
|
target_link_libraries(test_loader PRIVATE stinkytofu)
|
|
|
|
target_include_directories(test_loader PRIVATE
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../include"
|
|
)
|
|
|
|
# Make test_loader depend on intrinsics_compiled
|
|
add_dependencies(test_loader intrinsics_compiled)
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
# Auto-Load Demo
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
set(DEMO_AUTO_LOAD_SOURCES
|
|
demo_auto_load.cpp
|
|
)
|
|
|
|
add_executable(demo_auto_load "${DEMO_AUTO_LOAD_SOURCES}")
|
|
target_link_libraries(demo_auto_load PRIVATE stinkytofu-warnings)
|
|
|
|
# Link against the main stinkytofu library
|
|
target_link_libraries(demo_auto_load PRIVATE stinkytofu)
|
|
|
|
target_include_directories(demo_auto_load PRIVATE
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../include"
|
|
)
|
|
|
|
# Make demo depend on intrinsics_compiled
|
|
add_dependencies(demo_auto_load intrinsics_compiled)
|