Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Op CMake Fix #2598

Merged
merged 2 commits into from
Dec 12, 2023
Merged
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
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,22 @@ endif()

add_subdirectory(ThirdParty)

enable_testing()
if (NOT (DEFINED ENABLE_TESTS))
quic-ashvkuma marked this conversation as resolved.
Show resolved Hide resolved
message("Test build not explicitly disabled. Enabling implicitly")
set(ENABLE_TESTS ON CACHE BOOL "")
endif(NOT (DEFINED ENABLE_TESTS))

if (ENABLE_TESTS)
message("Compiling test targets enabled")
enable_testing()
add_subdirectory(NightlyTests)
else (ENABLE_TESTS)
message("Compiling test targets disabled")
endif()

add_subdirectory(ModelOptimizations)
add_subdirectory(TrainingExtensions)
add_subdirectory(Examples)
add_subdirectory(NightlyTests)
add_subdirectory(Docs)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Benchmarks")
add_subdirectory(Benchmarks)
Expand Down
5 changes: 4 additions & 1 deletion ModelOptimizations/DlCompression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/DlCompression
DESTINATION ${AIMET_INSTALL_DIR}/lib/x86_64-linux-gnu/include)

add_subdirectory(test)
if (ENABLE_TESTS)
add_subdirectory(test)
endif()

whl_add_whl_prep_common_target(DlCompression)
5 changes: 4 additions & 1 deletion ModelOptimizations/DlEqualization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/DlEqualization
DESTINATION ${AIMET_INSTALL_DIR}/lib/x86_64-linux-gnu/include)

add_subdirectory(test)
if (ENABLE_TESTS)
add_subdirectory(test)
endif()

whl_add_whl_prep_common_target(DlEqualization)
5 changes: 4 additions & 1 deletion ModelOptimizations/DlQuantization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@ endif (ENABLE_CUDA)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/DlQuantization
DESTINATION ${AIMET_INSTALL_DIR}/lib/x86_64-linux-gnu/include)

add_subdirectory(test)
if (ENABLE_TESTS)
add_subdirectory(test)
endif()

whl_add_whl_prep_common_target(DlQuantization)
5 changes: 4 additions & 1 deletion TrainingExtensions/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
#==============================================================================

add_subdirectory(src/python)
add_subdirectory(test)

if (ENABLE_TESTS)
add_subdirectory(test)
endif()

add_custom_target(whl_prep_cp_common DEPENDS
whl_prep_cp_common_DlCompression
Expand Down
4 changes: 3 additions & 1 deletion TrainingExtensions/onnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ find_path(ONNXRUNTIME_INC "onnxruntime_cxx_api.h" PATH_SUFFIXES onnxruntime_head
find_package(Eigen3 REQUIRED)

add_subdirectory(src/python)
add_subdirectory(test)

if (ENABLE_TESTS)
add_subdirectory(test)
endif()

add_library(OnnxCppOps SHARED
src/QcQuantizeOp.h
Expand Down
5 changes: 4 additions & 1 deletion TrainingExtensions/tensorflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,7 @@ add_dependencies(whl_prep_ln whl_prep_ln_tensorflow)
whl_add_whl_action_target(tensorflow)

add_subdirectory(src/python)
add_subdirectory(test)

if (ENABLE_TESTS)
add_subdirectory(test)
endif()
5 changes: 3 additions & 2 deletions TrainingExtensions/torch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ add_subdirectory(src/python)
if (ENABLE_ONNX)
message(STATUS "ONNX is enabled, skipping Torch Unit test")
else(ENABLE_ONNX)
add_subdirectory(test)
if (ENABLE_TESTS)
add_subdirectory(test)
endif()
endif(ENABLE_ONNX)


install(DIRECTORY ${CMAKE_BINARY_DIR}/artifacts/aimet_common/
DESTINATION ${AIMET_INSTALL_DIR}/lib/python/aimet_common
FILES_MATCHING PATTERN "AimetTensorQuantizer*.so"
Expand Down
Loading