Skip to content

Commit

Permalink
#9457: Re-enable PCH (#9461)
Browse files Browse the repository at this point in the history
#9457: re-enable pch
  • Loading branch information
ayerofieiev-tt authored Jun 17, 2024
1 parent 6254763 commit c11d4c0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ else()
endif()

# Can't use the `REUSE_FROM` option bc tt_lib and ttnn have different build flags :(
# add_library(pch_pybinds INTERFACE)
# target_precompile_headers(pch_pybinds INTERFACE
# ${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include/pybind11/operators.h
# ${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include/pybind11/pybind11.h
# ${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include/pybind11/stl.h
# )
add_library(pch_pybinds INTERFACE)
target_precompile_headers(pch_pybinds INTERFACE
${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include/pybind11/operators.h
${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include/pybind11/pybind11.h
${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include/pybind11/stl.h
)

############################################################################################################################
# Build subdirectories
Expand Down
18 changes: 9 additions & 9 deletions tt_eager/tt_dnn/op_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ target_include_directories(tt_dnn PUBLIC
${PROJECT_SOURCE_DIR}/tt_metal/third_party/fmt
)

# target_precompile_headers(tt_dnn PUBLIC
# ${PROJECT_SOURCE_DIR}/tt_metal/third_party/magic_enum/magic_enum.hpp
# ${PROJECT_SOURCE_DIR}/tt_metal/third_party/tracy/public/tracy/Tracy.hpp
# ${CMAKE_CURRENT_SOURCE_DIR}/auto_format.hpp
# ${CMAKE_CURRENT_SOURCE_DIR}/compute_kernel_config.hpp
# ${CMAKE_CURRENT_SOURCE_DIR}/operation.hpp
# ${CMAKE_CURRENT_SOURCE_DIR}/run_operation.hpp
# ${CMAKE_CURRENT_SOURCE_DIR}/work_split.hpp
# )
target_precompile_headers(tt_dnn PUBLIC
${PROJECT_SOURCE_DIR}/tt_metal/third_party/magic_enum/magic_enum.hpp
${PROJECT_SOURCE_DIR}/tt_metal/third_party/tracy/public/tracy/Tracy.hpp
${CMAKE_CURRENT_SOURCE_DIR}/auto_format.hpp
${CMAKE_CURRENT_SOURCE_DIR}/compute_kernel_config.hpp
${CMAKE_CURRENT_SOURCE_DIR}/operation.hpp
${CMAKE_CURRENT_SOURCE_DIR}/run_operation.hpp
${CMAKE_CURRENT_SOURCE_DIR}/work_split.hpp
)
2 changes: 1 addition & 1 deletion tt_eager/tt_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(TT_LIB_SRCS
# TODO: should be using pybind11_add_module, but right now it introduces many build problems
# pybinds will always be built as a shared library
add_library(tt_lib SHARED ${TT_LIB_SRCS})
target_link_libraries(tt_lib PUBLIC compiler_flags linker_flags tt_eager tt_metal) # linker_flags = -rdynamic if tracy enabled
target_link_libraries(tt_lib PUBLIC compiler_flags linker_flags tt_eager tt_metal pch_pybinds) # linker_flags = -rdynamic if tracy enabled
target_include_directories(tt_lib PUBLIC
${UMD_HOME}
${PROJECT_SOURCE_DIR}
Expand Down
9 changes: 4 additions & 5 deletions ttnn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ target_include_directories(ttnn_lib PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/cpp
${PROJECT_SOURCE_DIR}/tt_metal/third_party/fmt
)
# target_precompile_headers(ttnn_lib PRIVATE
# ${PROJECT_SOURCE_DIR}/tt_metal/third_party/magic_enum/magic_enum.hpp
# )

target_precompile_headers(ttnn_lib PRIVATE
${PROJECT_SOURCE_DIR}/tt_metal/third_party/magic_enum/magic_enum.hpp
)

# TODO: should be using pybind11_add_module, but right now it introduces many build problems
# pybinds will always be built as a shared library
add_library(ttnn SHARED ${PROJECT_SOURCE_DIR}/ttnn/cpp/pybind11/__init__.cpp $<TARGET_OBJECTS:ttnn_lib>)
target_compile_options(ttnn PUBLIC -Wno-int-to-pointer-cast -fno-var-tracking)
target_link_libraries(ttnn PUBLIC compiler_flags linker_flags tt_eager) # linker_flags = -rdynamic if tracy enabled
target_link_libraries(ttnn PUBLIC compiler_flags linker_flags tt_eager pch_pybinds) # linker_flags = -rdynamic if tracy enabled
target_include_directories(ttnn PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/cpp
${PROJECT_SOURCE_DIR}/tt_metal/third_party/pybind11/include
Expand Down

0 comments on commit c11d4c0

Please sign in to comment.