Skip to content

Commit 2b2ffe7

Browse files
author
Jenkins
committed
Compute Library v23.05.1
1 parent 6c713f0 commit 2b2ffe7

File tree

33 files changed

+371
-196
lines changed

33 files changed

+371
-196
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ build --flag_alias=openmp=//:openmp
3838
build --flag_alias=cppthreads=//:cppthreads
3939
build --flag_alias=enable_bf16_validation=//:enable_bf16_validation
4040
build --flag_alias=enable_sve_validation=//:enable_sve_validation
41+
build --flag_alias=arch=//:arch

BUILD.bazel

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ bool_flag(
7878
visibility = ["//visibility:public"],
7979
)
8080

81+
string_flag(
82+
name = "arch",
83+
build_setting_default = "armv8-a",
84+
values = [
85+
"armv8-a",
86+
"armv8.2-a+fp16"
87+
]
88+
)
89+
8190
#---------------------------------------------------------------------
8291
# Flag variables
8392
config_setting(
@@ -129,6 +138,20 @@ config_setting(
129138
},
130139
)
131140

141+
config_setting(
142+
name = "arch_armv8-a",
143+
flag_values = {
144+
"arch": "armv8-a"
145+
}
146+
)
147+
148+
config_setting(
149+
name = "arch_armv8.2-a+fp16",
150+
flag_values = {
151+
"arch": "armv8.2-a+fp16"
152+
}
153+
)
154+
132155

133156
#---------------------------------------------------------------------
134157
# Common defines used for all targets
@@ -138,17 +161,15 @@ cc_library(
138161
"ENABLE_NEON",
139162
"ARM_COMPUTE_CPU_ENABLED",
140163
"ARM_COMPUTE_ENABLE_NEON",
141-
"ARM_COMPUTE_ENABLE_FP16",
142164
"ARM_COMPUTE_ENABLE_I8MM",
143-
"ENABLE_FP16_KERNELS",
144165
"ENABLE_FP32_KERNELS",
145166
"ENABLE_QASYMM8_KERNELS",
146167
"ENABLE_QASYMM8_SIGNED_KERNELS",
147168
"ENABLE_QSYMM16_KERNELS",
148169
"ENABLE_INTEGER_KERNELS",
149170
"ENABLE_NHWC_KERNELS",
150171
"ENABLE_NCHW_KERNELS",
151-
"DARM_COMPUTE_GRAPH_ENABLED",
172+
"ARM_COMPUTE_GRAPH_ENABLED",
152173
"ARM_COMPUTE_ENABLE_SVEF32MM",
153174
"ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS",
154175
"_GLIBCXX_USE_NANOSLEEP"
@@ -170,6 +191,11 @@ cc_library(
170191
select({
171192
"//:openmp_flag": ["ARM_COMPUTE_OPENMP_SCHEDULER"],
172193
"//conditions:default": [],
194+
}) +
195+
select({
196+
"//:arch_armv8-a": [],
197+
"//:arch_armv8.2-a+fp16": ["ENABLE_FP16_KERNELS", "ARM_COMPUTE_ENABLE_FP16"],
198+
"//conditions:default": [],
173199
}),
174200
visibility = ["//visibility:public"],
175201
)
@@ -178,9 +204,9 @@ cc_library(
178204
# Rule for creating file "arm_compute_version.embed"
179205
genrule(
180206
name = "create_version_file",
181-
srcs = [".git/HEAD"],
207+
srcs = ["SConscript"],
182208
outs = ["arm_compute_version.embed"],
183-
cmd = "$(location //scripts:print_version_file) bazel-build-options `cat $(location :.git/HEAD)` > $@",
209+
cmd = "$(location //scripts:print_version_file) 'n/a' 'n/a' 'true' > $@",
184210
tools = ["//scripts:print_version_file"],
185211
visibility = ["//visibility:public"],
186212
)
@@ -191,9 +217,11 @@ genrule(
191217
cc_library(
192218
name = "arm_compute_graph",
193219
srcs = ["//src:arm_compute_graph_srcs"],
194-
copts = [
195-
"-march=armv8.2-a+fp16",
196-
] + select({
220+
copts = [] + select({
221+
"//:arch_armv8-a": ["-march=armv8-a"],
222+
"//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
223+
"//conditions:default": ["-march=armv8-a"],
224+
}) + select({
197225
"//:debug_flag": [
198226
"-O0",
199227
"-g",
@@ -211,7 +239,7 @@ cc_library(
211239
}),
212240
visibility = ["//visibility:public"],
213241
deps = [
214-
"arm_compute_core",
242+
"arm_compute",
215243
"//:common_defines",
216244
"//arm_compute:graph_headers",
217245
],
@@ -323,18 +351,20 @@ cc_library(
323351
# Core and Runtime library
324352

325353
cc_library(
326-
name = "arm_compute_core",
327-
srcs = ["//src:arm_compute_core_srcs"],
354+
name = "arm_compute",
355+
srcs = ["//src:arm_compute_srcs"],
328356
hdrs = glob([
329357
"core/NEON/kernels/**/*.h",
330358
"core/NEON/kernels/**/*.hpp",
331359
"**/*.inl",
332360
]) + [
333361
"//:create_version_file",
334362
],
335-
copts = [
336-
"-march=armv8.2-a+fp16",
337-
] + select({
363+
copts = [] + select({
364+
"//:arch_armv8-a": ["-march=armv8-a"],
365+
"//:arch_armv8.2-a+fp16": ["-march=armv8.2-a+fp16"],
366+
"//conditions:default": ["-march=armv8-a"],
367+
}) + select({
338368
"//:debug_flag": [
339369
"-O0",
340370
"-g",

CMakeLists.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
2828
list(APPEND CMAKE_MESSAGE_CONTEXT ArmCompute)
2929
project(
3030
ArmCompute
31-
VERSION 28.0.8
31+
VERSION 31.0.1
3232
DESCRIPTION
3333
"The Arm Compute Library is a collection of low-level machine learning functions optimized for Arm® Cortex®-A CPU and Arm® Mali™ GPU architectures"
3434
LANGUAGES C CXX ASM)
@@ -185,13 +185,13 @@ target_include_directories(
185185
# ---------------------------------------------------------------------
186186
# Core Library
187187

188-
add_library(arm_compute_core "")
189-
target_compile_options(arm_compute_core PRIVATE "-march=armv8.2-a+fp16")
190-
target_compile_definitions(arm_compute_core PRIVATE ARM_COMPUTE_ENABLE_BF16)
191-
target_compile_definitions(arm_compute_core PRIVATE ENABLE_SVE)
192-
target_compile_definitions(arm_compute_core PRIVATE ARM_COMPUTE_ENABLE_SVE)
188+
add_library(arm_compute "")
189+
target_compile_options(arm_compute PRIVATE "-march=${ARM_COMPUTE_ARCH}")
190+
target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_BF16)
191+
target_compile_definitions(arm_compute PRIVATE ENABLE_SVE)
192+
target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_SVE)
193193
target_include_directories(
194-
arm_compute_core
194+
arm_compute
195195
PUBLIC $<INSTALL_INTERFACE:include>
196196
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
197197
${CMAKE_CURRENT_SOURCE_DIR}
@@ -201,17 +201,17 @@ target_include_directories(
201201
src/core/NEON/kernels/convolution/common
202202
src/core/NEON/kernels/arm_conv/depthwise
203203
src/core/NEON/kernels/convolution/winograd)
204-
target_compile_options(arm_compute_core PUBLIC ${COMMON_CXX_FLAGS})
204+
target_compile_options(arm_compute PUBLIC ${COMMON_CXX_FLAGS})
205205

206-
add_library(ArmCompute::Core ALIAS arm_compute_core)
206+
add_library(ArmCompute::Core ALIAS arm_compute)
207207
target_link_libraries(
208-
arm_compute_core PUBLIC arm_compute_sve arm_compute_sve2)
208+
arm_compute PUBLIC arm_compute_sve arm_compute_sve2)
209209

210210
# ---------------------------------------------------------------------
211211
# Graph Library
212212

213213
add_library(arm_compute_graph "")
214-
target_compile_options(arm_compute_graph PRIVATE "-march=armv8.2-a+fp16")
214+
target_compile_options(arm_compute_graph PRIVATE "-march=${ARM_COMPUTE_ARCH}")
215215
target_compile_definitions(arm_compute_graph PRIVATE ENABLE_SVE)
216216
target_compile_definitions(arm_compute_graph PRIVATE ARM_COMPUTE_ENABLE_SVE)
217217
# add_subdirectory(src/graph)
@@ -242,7 +242,7 @@ if(ARM_COMPUTE_BUILD_TESTING)
242242
# target_compile_options(arm_compute_validation_framework PRIVATE
243243
# "-march=armv8.2-a")
244244
target_compile_options(arm_compute_validation_framework
245-
PRIVATE "-march=armv8.2-a+fp16")
245+
PRIVATE "-march=${ARM_COMPUTE_ARCH}")
246246

247247
add_subdirectory(tests)
248248
target_include_directories(
@@ -254,13 +254,13 @@ if(ARM_COMPUTE_BUILD_TESTING)
254254
PUBLIC ${COMMON_CXX_FLAGS})
255255
target_link_libraries(
256256
arm_compute_validation_framework
257-
PUBLIC arm_compute_core arm_compute_graph)
257+
PUBLIC arm_compute arm_compute_graph)
258258

259259
# ---------------------------------------------------------------------
260260
# Validation Binary
261261

262262
add_executable(arm_compute_validation "")
263-
target_compile_options(arm_compute_validation PRIVATE "-march=armv8.2-a+fp16")
263+
target_compile_options(arm_compute_validation PRIVATE "-march=${ARM_COMPUTE_ARCH}")
264264
if(ARM_COMPUTE_ENABLE_BF16_VALIDATION)
265265
target_compile_definitions(arm_compute_validation PRIVATE ARM_COMPUTE_ENABLE_BF16)
266266
endif()
@@ -275,23 +275,23 @@ if(ARM_COMPUTE_BUILD_TESTING)
275275
"${CMAKE_BINARY_DIR}/validation")
276276
target_link_libraries(
277277
arm_compute_validation
278-
PUBLIC arm_compute_core arm_compute_graph arm_compute_validation_framework
278+
PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework
279279
arm_compute_sve)
280280
target_link_directories(arm_compute_validation PUBLIC tests)
281281

282282
# ---------------------------------------------------------------------
283283
# Benchmark Binary
284284

285285
add_executable(arm_compute_benchmark)
286-
target_compile_options(arm_compute_benchmark PRIVATE "-march=armv8.2-a+fp16")
286+
target_compile_options(arm_compute_benchmark PRIVATE "-march=${ARM_COMPUTE_ARCH}")
287287

288288
add_subdirectory(tests/benchmark)
289289
target_compile_options(arm_compute_benchmark PUBLIC ${COMMON_CXX_FLAGS})
290290
set_target_properties(
291291
arm_compute_benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY
292292
"${CMAKE_BINARY_DIR}/validation")
293293
target_link_libraries(
294-
arm_compute_benchmark PUBLIC arm_compute_core arm_compute_graph
294+
arm_compute_benchmark PUBLIC arm_compute arm_compute_graph
295295
arm_compute_validation_framework)
296296

297297
endif() # ARM_COMPUTE_BUILD_TESTING
@@ -307,22 +307,22 @@ if(ARM_COMPUTE_BUILD_EXAMPLES)
307307
add_executable(
308308
${test_name} "examples/${test_name}.cpp" utils/Utils.cpp
309309
utils/GraphUtils.cpp utils/CommonGraphOptions.cpp)
310-
target_compile_options(${test_name} PRIVATE "-march=armv8.2-a+fp16")
310+
target_compile_options(${test_name} PRIVATE "-march=${ARM_COMPUTE_ARCH}")
311311
set_target_properties(
312312
${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
313313
"${CMAKE_BINARY_DIR}/examples")
314-
target_link_libraries(${test_name} PUBLIC arm_compute_core
314+
target_link_libraries(${test_name} PUBLIC arm_compute
315315
arm_compute_graph arm_compute_sve)
316316
endforeach()
317317

318318
# NEON Examples
319319
foreach(test_name ${EXAMPLE_NEON_NAMES})
320320
add_executable(${test_name} "examples/${test_name}.cpp" utils/Utils.cpp)
321-
target_compile_options(${test_name} PRIVATE "-march=armv8.2-a+fp16")
321+
target_compile_options(${test_name} PRIVATE "-march=${ARM_COMPUTE_ARCH}")
322322
set_target_properties(
323323
${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
324324
"${CMAKE_BINARY_DIR}/examples")
325-
target_link_libraries(${test_name} PUBLIC arm_compute_core)
325+
target_link_libraries(${test_name} PUBLIC arm_compute)
326326
endforeach()
327327

328328
endif() # ARM_COMPUTE_BUILD_EXAMPLES

0 commit comments

Comments
 (0)