diff options
author | David Svantesson <david.svantesson@arm.com> | 2023-06-08 10:05:59 +0000 |
---|---|---|
committer | David Svantesson <david.svantesson@arm.com> | 2023-06-22 14:35:20 +0000 |
commit | 90d15b985dbefd730941cbc79997baa0089dc4f3 (patch) | |
tree | 0c06e95c2e626c751d6222118dd5fcd630d2e65f /CMakeLists.txt | |
parent | da9cb7087ced66323d840332878e9ef9c833e862 (diff) | |
download | ComputeLibrary-90d15b985dbefd730941cbc79997baa0089dc4f3.tar.gz |
Bazel and CMake optional fp16 support
Resolves ONCPUML-1274
Signed-off-by: David Svantesson <david.svantesson@arm.com>
Change-Id: I1d189596cfce5be87a18c8065d683700b3c9960f
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9745
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: SiCong Li <sicong.li@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 94ae15fea5..4f8fc4afc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,13 +185,13 @@ target_include_directories( # --------------------------------------------------------------------- # Core Library -add_library(arm_compute_core "") -target_compile_options(arm_compute_core PRIVATE "-march=armv8.2-a+fp16") -target_compile_definitions(arm_compute_core PRIVATE ARM_COMPUTE_ENABLE_BF16) -target_compile_definitions(arm_compute_core PRIVATE ENABLE_SVE) -target_compile_definitions(arm_compute_core PRIVATE ARM_COMPUTE_ENABLE_SVE) +add_library(arm_compute "") +target_compile_options(arm_compute PRIVATE "-march=${ARM_COMPUTE_ARCH}") +target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_BF16) +target_compile_definitions(arm_compute PRIVATE ENABLE_SVE) +target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_SVE) target_include_directories( - arm_compute_core + arm_compute PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ${CMAKE_CURRENT_SOURCE_DIR} @@ -202,17 +202,17 @@ target_include_directories( src/core/NEON/kernels/convolution/common src/core/NEON/kernels/arm_conv/depthwise src/core/NEON/kernels/convolution/winograd) -target_compile_options(arm_compute_core PUBLIC ${COMMON_CXX_FLAGS}) +target_compile_options(arm_compute PUBLIC ${COMMON_CXX_FLAGS}) -add_library(ArmCompute::Core ALIAS arm_compute_core) +add_library(ArmCompute::Core ALIAS arm_compute) target_link_libraries( - arm_compute_core PUBLIC arm_compute_sve arm_compute_sve2) + arm_compute PUBLIC arm_compute_sve arm_compute_sve2) # --------------------------------------------------------------------- # Graph Library add_library(arm_compute_graph "") -target_compile_options(arm_compute_graph PRIVATE "-march=armv8.2-a+fp16") +target_compile_options(arm_compute_graph PRIVATE "-march=${ARM_COMPUTE_ARCH}") target_compile_definitions(arm_compute_graph PRIVATE ENABLE_SVE) target_compile_definitions(arm_compute_graph PRIVATE ARM_COMPUTE_ENABLE_SVE) # add_subdirectory(src/graph) @@ -244,7 +244,7 @@ if(ARM_COMPUTE_BUILD_TESTING) # target_compile_options(arm_compute_validation_framework PRIVATE # "-march=armv8.2-a") target_compile_options(arm_compute_validation_framework - PRIVATE "-march=armv8.2-a+fp16") + PRIVATE "-march=${ARM_COMPUTE_ARCH}") add_subdirectory(tests) target_include_directories( @@ -256,13 +256,13 @@ if(ARM_COMPUTE_BUILD_TESTING) PUBLIC ${COMMON_CXX_FLAGS}) target_link_libraries( arm_compute_validation_framework - PUBLIC arm_compute_core arm_compute_graph) + PUBLIC arm_compute arm_compute_graph) # --------------------------------------------------------------------- # Validation Binary add_executable(arm_compute_validation "") - target_compile_options(arm_compute_validation PRIVATE "-march=armv8.2-a+fp16") + target_compile_options(arm_compute_validation PRIVATE "-march=${ARM_COMPUTE_ARCH}") if(ARM_COMPUTE_ENABLE_BF16_VALIDATION) target_compile_definitions(arm_compute_validation PRIVATE ARM_COMPUTE_ENABLE_BF16) endif() @@ -277,7 +277,7 @@ if(ARM_COMPUTE_BUILD_TESTING) "${CMAKE_BINARY_DIR}/validation") target_link_libraries( arm_compute_validation - PUBLIC arm_compute_core arm_compute_graph arm_compute_validation_framework + PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework arm_compute_sve) target_link_directories(arm_compute_validation PUBLIC tests) @@ -285,7 +285,7 @@ if(ARM_COMPUTE_BUILD_TESTING) # Benchmark Binary add_executable(arm_compute_benchmark) - target_compile_options(arm_compute_benchmark PRIVATE "-march=armv8.2-a+fp16") + target_compile_options(arm_compute_benchmark PRIVATE "-march=${ARM_COMPUTE_ARCH}") add_subdirectory(tests/benchmark) target_compile_options(arm_compute_benchmark PUBLIC ${COMMON_CXX_FLAGS}) @@ -293,7 +293,7 @@ if(ARM_COMPUTE_BUILD_TESTING) arm_compute_benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/validation") target_link_libraries( - arm_compute_benchmark PUBLIC arm_compute_core arm_compute_graph + arm_compute_benchmark PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework) endif() # ARM_COMPUTE_BUILD_TESTING @@ -309,22 +309,22 @@ if(ARM_COMPUTE_BUILD_EXAMPLES) add_executable( ${test_name} "examples/${test_name}.cpp" utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp) - target_compile_options(${test_name} PRIVATE "-march=armv8.2-a+fp16") + target_compile_options(${test_name} PRIVATE "-march=${ARM_COMPUTE_ARCH}") set_target_properties( ${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples") - target_link_libraries(${test_name} PUBLIC arm_compute_core + target_link_libraries(${test_name} PUBLIC arm_compute arm_compute_graph arm_compute_sve) endforeach() # NEON Examples foreach(test_name ${EXAMPLE_NEON_NAMES}) add_executable(${test_name} "examples/${test_name}.cpp" utils/Utils.cpp) - target_compile_options(${test_name} PRIVATE "-march=armv8.2-a+fp16") + target_compile_options(${test_name} PRIVATE "-march=${ARM_COMPUTE_ARCH}") set_target_properties( ${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples") - target_link_libraries(${test_name} PUBLIC arm_compute_core) + target_link_libraries(${test_name} PUBLIC arm_compute) endforeach() endif() # ARM_COMPUTE_BUILD_EXAMPLES |