Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extension/llm/custom_ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ if(EXECUTORCH_BUILD_KERNELS_LLM_AOT)
${CMAKE_CURRENT_SOURCE_DIR}/op_tile_crop.cpp
${CMAKE_CURRENT_SOURCE_DIR}/op_tile_crop_aot.cpp
)
# This lib compiles real PyTorch headers, which require C++20.
set_target_properties(custom_ops_aot_lib PROPERTIES CXX_STANDARD 20)
target_include_directories(
custom_ops_aot_lib PRIVATE "${_common_include_directories}"
)
Expand Down
2 changes: 2 additions & 0 deletions tools/cmake/Codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ function(gen_custom_ops_aot_lib)
find_package_torch()
# This lib uses ATen lib, so we explicitly enable rtti and exceptions.
target_compile_options(${GEN_LIB_NAME} PRIVATE -frtti -fexceptions)
# ATen headers require C++20.
set_target_properties(${GEN_LIB_NAME} PROPERTIES CXX_STANDARD 20)
target_compile_definitions(${GEN_LIB_NAME} PRIVATE USE_ATEN_LIB=1)
include_directories(${TORCH_INCLUDE_DIRS})
target_link_libraries(${GEN_LIB_NAME} PRIVATE torch)
Expand Down
Loading