aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Svantesson <david.svantesson@arm.com>2022-12-15 16:25:57 +0000
committerDavid Svantesson <david.svantesson@arm.com>2023-01-31 14:57:06 +0000
commite0c42ef651709fd284da3bedd2c98d420bd6fd1a (patch)
tree6c154adf5937946b85fd46a30e3b3ce4c3ea5717 /tests
parent54eafd86fdeb19f2117271805a01da4395f9ef16 (diff)
downloadComputeLibrary-e0c42ef651709fd284da3bedd2c98d420bd6fd1a.tar.gz
Bazel and CMake builds
Resolves: ONCPUML-1110, ONCPUML-1109 Co-authored-by: Georgios Pinitas <georgios.pinitas@arm.com> Co-authored-by: Joe Ramsay <joe.ramsay@arm.com> Signed-off-by: David Svantesson <david.svantesson@arm.com> Change-Id: Iea693dbe53bf0af87867d6a9e0d1fd9fbe59ef3a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8981 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/BUILD.bazel92
-rw-r--r--tests/CMakeLists.txt130
-rw-r--r--tests/benchmark/CMakeLists.txt23
-rw-r--r--tests/framework/BUILD.bazel60
-rw-r--r--tests/validation/CMakeLists.txt145
5 files changed, 450 insertions, 0 deletions
diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel
new file mode 100644
index 0000000000..57ea3f6576
--- /dev/null
+++ b/tests/BUILD.bazel
@@ -0,0 +1,92 @@
+# Copyright (c) 2023 Arm Limited.
+#
+# SPDX-License-Identifier: MIT
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+#---------------------------------------------------------------------
+# Validation Framework Library
+
+cc_library(
+ name = "validation_framework",
+ srcs = glob([
+ "validation/reference/*.cpp",
+ "validation/*.cpp",
+ "*.h",
+ ]),
+ hdrs = glob([
+ "validation/reference/*.h",
+ "validation/**/*.h",
+ ]),
+ copts = [
+ "-march=armv8.2-a+fp16",
+ ],
+ linkstatic = True,
+ deps = [
+ "//:arm_compute",
+ "//:common_defines",
+ "//tests/framework",
+ ],
+)
+
+#---------------------------------------------------------------------
+# Validation Binary
+cc_binary(
+ name = "arm_compute_validation",
+ srcs = glob([
+ "validation/UNIT/**/*.cpp",
+ "validation/CPP/**/*.cpp",
+ "NEON/*.h",
+ "validation/NEON/**/*.cpp",
+ "validation/NEON/**/*.h",
+ "*.cpp",
+ "datasets/*.h",
+ "instruments/*.h",
+ ]),
+ copts = [
+ "-march=armv8.2-a+fp16",
+ "-ffp-contract=off",
+ ],
+ linkstatic = True,
+ deps = [
+ ":validation_framework",
+ "//:arm_compute",
+ "//:arm_compute_graph",
+ "//:common_defines",
+ "//tests/framework",
+ ],
+)
+
+#---------------------------------------------------------------------
+# Benchmark Binary
+cc_binary(
+ name = "arm_benchmark",
+ srcs = glob([
+ "benchmark/fixtures/*.h",
+ "benchmark/NEON/*.cpp",
+ "*.cpp",
+ ]),
+ copts = ["-march=armv8.2-a+fp16"],
+ linkstatic = True,
+ deps = [
+ ":arm_compute_validation",
+ ":validation_framework",
+ "//:arm_compute",
+ ],
+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000000..163ab82e91
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,130 @@
+# Copyright (c) 2023 Arm Limited.
+#
+# SPDX-License-Identifier: MIT
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+target_sources(
+ arm_compute_validation_framework
+ PRIVATE validation/Validation.cpp
+ validation/Helpers.cpp
+ validation/reference/BoundingBoxTransform.cpp
+ validation/reference/GEMMReshapeRHSMatrix.cpp
+ validation/reference/ChannelShuffle.cpp
+ validation/reference/Logical.cpp
+ validation/reference/PoolingLayer.cpp
+ validation/reference/BitwiseNot.cpp
+ validation/reference/Conv3D.cpp
+ validation/reference/GEMMReshapeLHSMatrix.cpp
+ validation/reference/ComputeAllAnchors.cpp
+ validation/reference/DepthConcatenateLayer.cpp
+ validation/reference/TableLookup.cpp
+ validation/reference/ROIPoolingLayer.cpp
+ validation/reference/SliceOperations.cpp
+ validation/reference/GEMMLowp.cpp
+ validation/reference/Unstack.cpp
+ validation/reference/Pooling3dLayer.cpp
+ validation/reference/BitwiseOr.cpp
+ validation/reference/ReshapeLayer.cpp
+ validation/reference/SoftmaxLayer.cpp
+ validation/reference/Gather.cpp
+ validation/reference/Utils.cpp
+ validation/reference/Accumulate.cpp
+ validation/reference/CropResize.cpp
+ validation/reference/ReductionOperation.cpp
+ validation/reference/ConcatenateLayer.cpp
+ validation/reference/PixelWiseMultiplication.cpp
+ validation/reference/DepthConvertLayer.cpp
+ validation/reference/Erode.cpp
+ validation/reference/DepthToSpaceLayer.cpp
+ validation/reference/PadLayer.cpp
+ validation/reference/MeanStdDevNormalizationLayer.cpp
+ validation/reference/BitwiseXor.cpp
+ validation/reference/GEMM.cpp
+ validation/reference/NormalizePlanarYUVLayer.cpp
+ validation/reference/FuseBatchNormalization.cpp
+ validation/reference/BitwiseAnd.cpp
+ validation/reference/SpaceToDepth.cpp
+ validation/reference/NonMaximaSuppression.cpp
+ validation/reference/Reverse.cpp
+ validation/reference/DFT.cpp
+ validation/reference/L2NormalizeLayer.cpp
+ validation/reference/ActivationLayer.cpp
+ validation/reference/SpaceToBatch.cpp
+ validation/reference/PostOps.cpp
+ validation/reference/Im2Col.cpp
+ validation/reference/DequantizationLayer.cpp
+ validation/reference/DeconvolutionLayer.cpp
+ validation/reference/MinMaxLocation.cpp
+ validation/reference/Select.cpp
+ validation/reference/BatchNormalizationLayer.cpp
+ validation/reference/InstanceNormalizationLayer.cpp
+ validation/reference/ROIAlignLayer.cpp
+ validation/reference/ElementwiseUnary.cpp
+ validation/reference/MeanStdDev.cpp
+ validation/reference/QLSTMLayerNormalization.cpp
+ validation/reference/Col2Im.cpp
+ validation/reference/FlattenLayer.cpp
+ validation/reference/AbsoluteDifference.cpp
+ validation/reference/Transpose.cpp
+ validation/reference/StackLayer.cpp
+ validation/reference/NormalizationLayer.cpp
+ validation/reference/Copy.cpp
+ validation/reference/MaxUnpoolingLayer.cpp
+ validation/reference/Winograd.cpp
+ validation/reference/Permute.cpp
+ validation/reference/Comparisons.cpp
+ validation/reference/Tile.cpp
+ validation/reference/BatchToSpaceLayer.cpp
+ validation/reference/ElementwiseOperations.cpp
+ validation/reference/QuantizationLayer.cpp
+ validation/reference/NonMaxSuppression.cpp
+ validation/reference/WeightsReshape.cpp
+ validation/reference/ArithmeticOperations.cpp
+ validation/reference/ConvertFullyConnectedWeights.cpp
+ validation/reference/Floor.cpp
+ validation/reference/PriorBoxLayer.cpp
+ validation/reference/Scale.cpp
+ validation/reference/ReorgLayer.cpp
+ validation/reference/Range.cpp
+ validation/reference/ArithmeticDivision.cpp
+ validation/reference/DepthwiseConvolutionLayer.cpp
+ validation/reference/FullyConnectedLayer.cpp
+ validation/reference/ConvolutionLayer.cpp
+ framework/Framework.cpp
+ framework/Utils.cpp
+ framework/Exceptions.cpp
+ framework/DatasetModes.cpp
+ framework/TestFilter.cpp
+ framework/Profiler.cpp
+ framework/ParametersLibrary.cpp
+ framework/command_line/CommonOptions.cpp
+ framework/instruments/WallClockTimer.cpp
+ framework/instruments/InstrumentsStats.cpp
+ framework/instruments/Instruments.cpp
+ framework/instruments/SchedulerTimer.cpp
+ framework/instruments/hwc_names.hpp
+ framework/instruments/hwc.hpp
+ framework/printers/PrettyPrinter.cpp
+ framework/printers/Printer.cpp
+ framework/printers/JSONPrinter.cpp
+ framework/printers/Printers.cpp
+ AssetsLibrary.cpp
+ RawTensor.cpp
+ main.cpp)
diff --git a/tests/benchmark/CMakeLists.txt b/tests/benchmark/CMakeLists.txt
new file mode 100644
index 0000000000..a3a352681e
--- /dev/null
+++ b/tests/benchmark/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Copyright (c) 2023 Arm Limited.
+#
+# SPDX-License-Identifier: MIT
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+target_sources(arm_compute_benchmark PRIVATE NEON/Scale.cpp)
diff --git a/tests/framework/BUILD.bazel b/tests/framework/BUILD.bazel
new file mode 100644
index 0000000000..084d12c991
--- /dev/null
+++ b/tests/framework/BUILD.bazel
@@ -0,0 +1,60 @@
+# Copyright (c) 2023 Arm Limited.
+#
+# SPDX-License-Identifier: MIT
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+cc_library(
+ name = "framework",
+ srcs = glob(
+ [
+ "*.cpp",
+ "command_line/*.cpp",
+ "printers/*.cpp",
+ "datasets/*.cpp",
+ "instruments/*.cpp",
+ "instruments/*.hpp",
+ ],
+ exclude = [
+ "**/*PMU*",
+ "**/*OpenCL*",
+ "**/*MaliCounter*",
+ ],
+ ),
+ hdrs = glob([
+ "*.h",
+ "command_line/*.h",
+ "printers/*.h",
+ "datasets/*.h",
+ "instruments/*.h",
+ ]),
+ copts = [
+ "-Wno-overloaded-virtual",
+ "-march=armv8.2-a+fp16",
+ ],
+ linkstatic = True,
+ visibility = ["//visibility:public"],
+ deps = [
+ "//arm_compute:core_headers",
+ "//arm_compute:graph_headers",
+ "//arm_compute:runtime_headers",
+ "//support",
+ "//utils",
+ ],
+)
diff --git a/tests/validation/CMakeLists.txt b/tests/validation/CMakeLists.txt
new file mode 100644
index 0000000000..eef062b5f9
--- /dev/null
+++ b/tests/validation/CMakeLists.txt
@@ -0,0 +1,145 @@
+# Copyright (c) 2023 Arm Limited.
+#
+# SPDX-License-Identifier: MIT
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+target_sources(
+ arm_compute_validation
+ PRIVATE UNIT/SafeIntegerOps.cpp
+ UNIT/Version.cpp
+ UNIT/TensorInfo.cpp
+ UNIT/TensorShape.cpp
+ UNIT/Utils.cpp
+ UNIT/SubTensorInfo.cpp
+ UNIT/WindowIterator.cpp
+ UNIT/LifetimeManager.cpp
+ UNIT/GPUTarget.cpp
+ CPP/DetectionPostProcessLayer.cpp
+ CPP/TopKV.cpp
+ CPP/DFT.cpp
+ CPP/Permute.cpp
+ CPP/NonMaximumSuppression.cpp)
+
+if(ENABLE_NEON)
+ target_sources(
+ arm_compute_validation
+ PRIVATE NEON/ElementwiseNegation.cpp
+ NEON/BoundingBoxTransform.cpp
+ NEON/ChannelShuffle.cpp
+ NEON/Logical.cpp
+ NEON/DilatedConvolutionLayer.cpp
+ NEON/PoolingLayer.cpp
+ NEON/BitwiseNot.cpp
+ NEON/FillBorder.cpp
+ NEON/ElementwiseRsqrtLayer.cpp
+ NEON/DepthConcatenateLayer.cpp
+ NEON/ElementwisePower.cpp
+ NEON/Fill.cpp
+ NEON/ROIPoolingLayer.cpp
+ NEON/LSTMLayer.cpp
+ NEON/ArithmeticSubtraction.cpp
+ NEON/GEMMLowp.cpp
+ NEON/Unstack.cpp
+ NEON/Slice.cpp
+ NEON/Pooling3dLayer.cpp
+ NEON/BitwiseOr.cpp
+ NEON/HeightConcatenateLayer.cpp
+ NEON/ReshapeLayer.cpp
+ NEON/SoftmaxLayer.cpp
+ NEON/Gather.cpp
+ NEON/CropResize.cpp
+ NEON/ReductionOperation.cpp
+ NEON/PixelWiseMultiplication.cpp
+ NEON/LogSoftmaxLayer.cpp
+ NEON/DepthConvertLayer.cpp
+ NEON/Flatten.cpp
+ NEON/ElementwiseKernelSelection.cpp
+ NEON/DepthToSpaceLayer.cpp
+ NEON/ElementwiseAbsoluteValue.cpp
+ NEON/PadLayer.cpp
+ NEON/MeanStdDevNormalizationLayer.cpp
+ NEON/GlobalPoolingLayer.cpp
+ NEON/RNNLayer.cpp
+ NEON/DetectionPostProcessLayer.cpp
+ NEON/ElementwiseRound.cpp
+ NEON/BitwiseXor.cpp
+ NEON/GEMM.cpp
+ NEON/FuseBatchNormalization.cpp
+ NEON/BitwiseAnd.cpp
+ NEON/ElementwiseMax.cpp
+ NEON/ReduceMean.cpp
+ NEON/Reverse.cpp
+ NEON/L2NormalizeLayer.cpp
+ NEON/Convolution3D.cpp
+ NEON/ArithmeticAddition.cpp
+ NEON/ActivationLayer.cpp
+ NEON/SpaceToBatchLayer.cpp
+ NEON/ElementwiseLog.cpp
+ NEON/LSTMLayerQuantized.cpp
+ NEON/Im2Col.cpp
+ NEON/DequantizationLayer.cpp
+ NEON/DeconvolutionLayer.cpp
+ NEON/Select.cpp
+ NEON/ElementwiseSin.cpp
+ NEON/PReluLayer.cpp
+ NEON/BatchNormalizationLayer.cpp
+ NEON/ElementwiseMin.cpp
+ NEON/InstanceNormalizationLayer.cpp
+ NEON/ROIAlignLayer.cpp
+ NEON/ElementwiseDivision.cpp
+ NEON/ElementwiseExpLayer.cpp
+ NEON/ArgMinMax.cpp
+ NEON/QLSTMLayerNormalization.cpp
+ NEON/Col2Im.cpp
+ NEON/Split.cpp
+ NEON/Transpose.cpp
+ NEON/GenerateProposalsLayer.cpp
+ NEON/StackLayer.cpp
+ NEON/WidthConcatenateLayer.cpp
+ NEON/NormalizationLayer.cpp
+ NEON/Copy.cpp
+ NEON/ElementwiseSquareDiff.cpp
+ NEON/MaxUnpoolingLayer.cpp
+ NEON/Permute.cpp
+ NEON/Comparisons.cpp
+ NEON/BatchConcatenateLayer.cpp
+ NEON/Tile.cpp
+ NEON/BatchToSpaceLayer.cpp
+ NEON/SpaceToDepthLayer.cpp
+ NEON/DepthwiseConvolutionLayerNative.cpp
+ NEON/QuantizationLayer.cpp
+ NEON/ConvertFullyConnectedWeights.cpp
+ NEON/Floor.cpp
+ NEON/FFT.cpp
+ NEON/Cast.cpp
+ NEON/PriorBoxLayer.cpp
+ NEON/Scale.cpp
+ NEON/ReorgLayer.cpp
+ NEON/Range.cpp
+ NEON/DirectConvolutionLayer.cpp
+ NEON/DepthwiseConvolutionLayer.cpp
+ NEON/FullyConnectedLayer.cpp
+ NEON/ConvolutionLayer.cpp
+ NEON/StridedSlice.cpp
+ NEON/UNIT/DynamicTensor.cpp
+ NEON/UNIT/TensorAllocator.cpp
+ NEON/UNIT/MemoryManager.cpp
+ NEON/UNIT/RuntimeContext.cpp)
+endif()