diff options
author | David Svantesson <david.svantesson@arm.com> | 2023-06-08 10:05:59 +0000 |
---|---|---|
committer | ramy.elgammal@arm.com <ramy.elgammal@arm.com> | 2023-06-27 18:31:22 +0100 |
commit | 604a35bdd9cfa8c4221ac146fb29b9166d78d045 (patch) | |
tree | 64e299e25c4dae3c87e34b1ecd363ed112540a6b /CMakeLists.txt | |
parent | ba62e9ac2428b8cd84c566d5b37ce8fde14868a2 (diff) | |
download | ComputeLibrary-604a35bdd9cfa8c4221ac146fb29b9166d78d045.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 3c6798784a..9dccdba00d 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} @@ -201,17 +201,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) @@ -242,7 +242,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( @@ -254,13 +254,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() @@ -275,7 +275,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) @@ -283,7 +283,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}) @@ -291,7 +291,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 @@ -307,22 +307,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 |