From 45514031440880a9eecd2a8461e6741569d8119a Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 30 Dec 2020 00:03:09 +0000 Subject: Add support for macOS * Add 'macos' as an additional OS build option * Guard unsupported paths like thread scheduling control and hwcaps checking with the __APPLE__ macro * Map linker options to respective Mach-O linker options Change-Id: I67bd9fa3c20831427b218ca7d3b4b9d454ab4fec Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4788 Reviewed-by: Sang-Hoon Park Reviewed-by: Giorgio Arena Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- SConscript | 5 ++-- SConstruct | 7 +++--- docs/00_introduction.dox | 39 ++++++++++++++++++++----------- examples/SConscript | 20 ++++++++++------ src/core/CPP/CPPTypes.cpp | 10 ++++---- src/runtime/CPP/CPPScheduler.cpp | 7 +++--- src/runtime/CPUUtils.cpp | 20 ++++++++-------- tests/SConscript | 20 ++++++++++------ tests/framework/instruments/Instruments.h | 6 ++--- utils/GraphUtils.cpp | 6 +++-- 10 files changed, 83 insertions(+), 57 deletions(-) diff --git a/SConscript b/SConscript index d3732271a1..229d7d1c26 100644 --- a/SConscript +++ b/SConscript @@ -137,7 +137,7 @@ arm_compute_env = env.Clone() version_file = arm_compute_env.Command("src/core/arm_compute_version.embed", "", action=create_version_file) arm_compute_env.AlwaysBuild(version_file) -default_cpp_compiler = 'g++' if env['os'] != 'android' else 'clang++' +default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++' cpp_compiler = os.environ.get('CXX', default_cpp_compiler) # Generate embed files @@ -171,7 +171,8 @@ arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSI # Don't allow undefined references in the libraries: -arm_compute_env.Append(LINKFLAGS=['-Wl,--no-undefined']) +undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined' +arm_compute_env.Append(LINKFLAGS=[undefined_flag]) arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] ) arm_compute_env.Append(LIBS = ['dl']) diff --git a/SConstruct b/SConstruct index e19d855210..4606159a0f 100644 --- a/SConstruct +++ b/SConstruct @@ -46,7 +46,7 @@ vars.AddVariables( allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64", "armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "armv8.6-a-sve", "armv8.6-a-sve2", "x86")), EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")), - EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "bare_metal")), + EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal")), EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")), BoolVariable("examples", "Build example programs", True), BoolVariable("gemm_tuner", "Build gemm_tuner programs", True), @@ -151,8 +151,8 @@ env.Append(CXXFLAGS = ['-Wall','-DARCH_ARM', env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP']) -default_cpp_compiler = 'g++' if env['os'] != 'android' else 'clang++' -default_c_compiler = 'gcc' if env['os'] != 'android' else 'clang' +default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++' +default_c_compiler = 'gcc' if env['os'] not in ['android', 'macos'] else 'clang' cpp_compiler = os.environ.get('CXX', default_cpp_compiler) c_compiler = os.environ.get('CC', default_c_compiler) @@ -220,7 +220,6 @@ elif 'v8' in env['arch']: env.Append(CPPDEFINES = ['MMLA_INT8', 'V8P6', 'V8P6_BF', 'ARM_COMPUTE_FORCE_BF16']) if "disable_mmla_fp" not in env['custom_options']: env.Append(CPPDEFINES = ['MMLA_FP32']) - elif 'x86' in env['arch']: if env['estate'] == '32': env.Append(CCFLAGS = ['-m32']) diff --git a/docs/00_introduction.dox b/docs/00_introduction.dox index 6edda04a59..86487bc8ec 100644 --- a/docs/00_introduction.dox +++ b/docs/00_introduction.dox @@ -30,7 +30,7 @@ namespace arm_compute The Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs using SIMD technologies. Several builds of the library are available using various configurations: - - OS: Linux, Android or bare metal. + - OS: Linux, Android, macOS or bare metal. - Architecture: armv7a (32bit) or arm64-v8a (64bit) - Technology: NEON / OpenCL / GLES_COMPUTE / NEON and OpenCL and GLES_COMPUTE - Debug / Asserts / Release: Use a build with asserts enabled to debug your application and enable extra validation. Once you are sure your application works as expected you can switch to a release build of the library for maximum performance. @@ -87,7 +87,8 @@ If there is more than one release in a month then an extra sequential number is @subsection S2_2_changelog Changelog v21.02 Public major release - - Upgraded C++ standard to C++14 + - Upgrade C++ standard to C++14 + - Add macOS support - Removed functions: - NELocallyConnectedLayer / CLLocallyConnectedLayer - NEIm2Col @@ -1337,7 +1338,7 @@ To see the build options available simply run ```scons -h```: default: auto actual: auto - os: Target OS (linux|android|tizen|bare_metal) + os: Target OS (linux|android|macos|tizen|bare_metal) default: linux actual: linux @@ -1815,7 +1816,17 @@ For example: In this case the first argument of LeNet (like all the graph examples) is the target (i.e 0 to run on NEON, 1 to run on OpenCL if available, 2 to run on OpenCL using the CLTuner), the second argument is the path to the folder containing the npy files for the weights and finally the third argument is the number of batches to run. -@subsection S3_4_bare_metal Building for bare metal +@subsection S3_4_macos Building for macOS + +The library was successfully natively built for Apple Silicon under macOS 11.1 using clang v12.0.0. + +To natively compile the library with accelerated CPU support: + + scons Werror=1 -j8 neon=1 opencl=0 os=macos arch=arm64-v8a build=native + +@note Initial support disables feature discovery through HWCAPS and thread scheduling affinity controls + +@subsection S3_5_bare_metal Building for bare metal For bare metal, the library was successfully built using linaro's latest (gcc-linaro-6.3.1-2017.05) bare metal toolchains: - arm-eabi for armv7a @@ -1825,24 +1836,24 @@ Download linaro for here. -@subsection S3_5_windows_host Building on a Windows host system +@subsection S3_6_windows_host Building on a Windows host system Using `scons` directly from the Windows command line is known to cause problems. The reason seems to be that if `scons` is setup for cross-compilation it gets confused about Windows style paths (using backslashes). Thus it is recommended to follow one of the options outlined below. -@subsubsection S3_5_1_ubuntu_on_windows Bash on Ubuntu on Windows +@subsubsection S3_6_1_ubuntu_on_windows Bash on Ubuntu on Windows The best and easiest option is to use Ubuntu on Windows. @@ -1850,7 +1861,7 @@ This feature is still marked as *beta* and thus might not be available. However, if it is building the library is as simple as opening a *Bash on Ubuntu on Windows* shell and following the general guidelines given above. -@subsubsection S3_5_2_cygwin Cygwin +@subsubsection S3_6_2_cygwin Cygwin If the Windows subsystem for Linux is not available Cygwin can be used to install and run `scons`, the minimum Cygwin version must be 3.0.7 or later. In addition @@ -1863,9 +1874,9 @@ compiler is included in the Android standalone toolchain. After everything has been set up in the Cygwin terminal the general guide on building the library can be followed. -@subsection S3_6_cl_requirements OpenCL DDK Requirements +@subsection S3_7_cl_requirements OpenCL DDK Requirements -@subsubsection S3_6_1_cl_hard_requirements Hard Requirements +@subsubsection S3_7_1_cl_hard_requirements Hard Requirements Compute Library requires OpenCL 1.1 and above with support of non uniform workgroup sizes, which is officially supported in the Mali OpenCL DDK r8p0 and above as an extension (respective extension flag is \a -cl-arm-non-uniform-work-group-size). @@ -1873,7 +1884,7 @@ Enabling 16-bit floating point calculations require \a cl_khr_fp16 extension to Use of @ref CLMeanStdDev function requires 64-bit atomics support, thus \a cl_khr_int64_base_atomics should be supported in order to use. -@subsubsection S3_6_2_cl_performance_requirements Performance improvements +@subsubsection S3_7_2_cl_performance_requirements Performance improvements Integer dot product built-in function extensions (and therefore optimized kernels) are available with Mali OpenCL DDK r22p0 and above for the following GPUs : G71, G76. The relevant extensions are \a cl_arm_integer_dot_product_int8, \a cl_arm_integer_dot_product_accumulate_int8 and \a cl_arm_integer_dot_product_accumulate_int16. @@ -1881,7 +1892,7 @@ OpenCL kernel level debugging can be simplified with the use of printf, this req SVM allocations are supported for all the underlying allocations in Compute Library. To enable this OpenCL 2.0 and above is a requirement. -@subsection S3_7_cl_tuner OpenCL Tuner +@subsection S3_8_cl_tuner OpenCL Tuner The OpenCL tuner, a.k.a. CLTuner, is a module of Arm Compute Library that can improve the performance of the OpenCL kernels tuning the Local-Workgroup-Size (LWS). The optimal LWS for each unique OpenCL kernel configuration is stored in a table. This table can be either imported or exported from/to a file. @@ -1929,7 +1940,7 @@ CLTuner looks for the optimal LWS for each unique OpenCL kernel configuration. S gemm1.configure(&a1, &b1, nullptr, &c1, 1.0f, 0.0f); @endcode -@subsubsection S3_7_1_cl_tuner_how_to How to use it +@subsubsection S3_8_1_cl_tuner_how_to How to use it All the graph examples in the Compute Library's folder "examples" and the arm_compute_benchmark accept an argument to enable the OpenCL tuner and an argument to export/import the LWS values to/from a file diff --git a/examples/SConscript b/examples/SConscript index ff457faf38..c7bc7dfb36 100644 --- a/examples/SConscript +++ b/examples/SConscript @@ -32,7 +32,7 @@ examples_env.Append(CPPPATH = ["#"]) # Build examples utils = examples_env.Object("../utils/Utils.cpp") -if env['os'] in ['android', 'bare_metal'] or env['standalone']: +if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: Import('arm_compute_graph_a') Import('arm_compute_a') Import('arm_compute_core_a') @@ -52,6 +52,12 @@ extra_link_flags = [] if env['os'] != 'bare_metal': extra_link_flags += ['-fstack-protector-strong'] +load_whole_archive = '-Wl,--whole-archive' +noload_whole_archive = '-Wl,--no-whole-archive' +if 'macos' in examples_env['os']: + load_whole_archive = '-Wl,-force_load' + noload_whole_archive = '-Wl,-noall_load' + # Build graph examples graph_utils = examples_env.Object("../utils/GraphUtils.cpp") graph_utils += examples_env.Object("../utils/CommonGraphOptions.cpp") @@ -60,8 +66,8 @@ for file in Glob("./graph_*.cpp"): example = os.path.basename(os.path.splitext(str(file))[0]) prog = None - if env['os'] in ['android', 'bare_metal'] or env['standalone']: - prog = examples_env.Program(example, ["{}.cpp".format(example), utils, graph_utils], LIBS = examples_libs + arm_compute_graph_libs, LINKFLAGS=examples_env["LINKFLAGS"]+['-Wl,--whole-archive',graph_dependency,'-Wl,--no-whole-archive'] + extra_link_flags) + if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: + prog = examples_env.Program(example, ["{}.cpp".format(example), utils, graph_utils], LIBS = examples_libs + arm_compute_graph_libs, LINKFLAGS=examples_env["LINKFLAGS"]+[load_whole_archive, graph_dependency, noload_whole_archive] + extra_link_flags) Depends(prog, graph_dependency) prog = install_bin(prog) else: @@ -95,8 +101,8 @@ if env['gemm_tuner'] and env['opencl']: for file in Glob("./gemm_tuner/cl_*.cpp"): example = os.path.basename(os.path.splitext(str(file))[0]) example = os.path.join("gemm_tuner", example) - if env['os'] in ['android', 'bare_metal'] or env['standalone']: - prog = examples_env.Program(example, ["{}.cpp".format(example), utils, gemm_tuner_common_options], CPPDEFINES=['ARM_COMPUTE_CL'], LIBS = examples_libs + arm_compute_graph_libs, LINKFLAGS=examples_env["LINKFLAGS"]+['-Wl,--whole-archive',graph_dependency,'-Wl,--no-whole-archive', '-fstack-protector-strong'] ) + if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: + prog = examples_env.Program(example, ["{}.cpp".format(example), utils, gemm_tuner_common_options], CPPDEFINES=['ARM_COMPUTE_CL'], LIBS = examples_libs + arm_compute_graph_libs, LINKFLAGS=examples_env["LINKFLAGS"]+[load_whole_archive, graph_dependency, noload_whole_archive, '-fstack-protector-strong'] ) Depends(prog, graph_dependency) prog = install_bin(prog) else: @@ -136,8 +142,8 @@ if env['external_tests_dir']: example = os.path.basename(os.path.splitext(str(file))[0]) prog = None - if env['os'] in ['android', 'bare_metal'] or env['standalone']: - prog = examples_env.Program(example, [examples_env.Object(source=file, target=example), utils, graph_utils], LIBS = examples_libs + arm_compute_graph_libs, LINKFLAGS=examples_env["LINKFLAGS"]+['-Wl,--whole-archive',graph_dependency,'-Wl,--no-whole-archive'] + extra_link_flags) + if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: + prog = examples_env.Program(example, [examples_env.Object(source=file, target=example), utils, graph_utils], LIBS = examples_libs + arm_compute_graph_libs, LINKFLAGS=examples_env["LINKFLAGS"]+[load_whole_archive, graph_dependency, noload_whole_archive] + extra_link_flags) Depends(prog, graph_dependency) prog = install_bin(prog) else: diff --git a/src/core/CPP/CPPTypes.cpp b/src/core/CPP/CPPTypes.cpp index 55119d80a8..139e106ca6 100644 --- a/src/core/CPP/CPPTypes.cpp +++ b/src/core/CPP/CPPTypes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,7 +26,7 @@ #include "arm_compute/core/Error.h" -#ifndef BARE_METAL +#if !defined(BARE_METAL) #include #endif /* defined(BARE_METAL) */ @@ -110,9 +110,9 @@ CPUInfo::CPUInfo() CPUModel CPUInfo::get_cpu_model() const { -#if defined(BARE_METAL) || (!defined(__arm__) && !defined(__aarch64__)) +#if defined(BARE_METAL) || defined(__APPLE__) || (!defined(__arm__) && !defined(__aarch64__)) return get_cpu_model(0); -#else /* defined(BARE_METAL) || (!defined(__arm__) && !defined(__aarch64__)) */ +#else /* defined(BARE_METAL) || defined(__APPLE__) || (!defined(__arm__) && !defined(__aarch64__)) */ return get_cpu_model(sched_getcpu()); -#endif /* defined(BARE_METAL) || (!defined(__arm__) && !defined(__aarch64__)) */ +#endif /* defined(BARE_METAL) || defined(__APPLE__) || (!defined(__arm__) && !defined(__aarch64__)) */ } diff --git a/src/runtime/CPP/CPPScheduler.cpp b/src/runtime/CPP/CPPScheduler.cpp index 663cde7a21..e084cc6494 100644 --- a/src/runtime/CPP/CPPScheduler.cpp +++ b/src/runtime/CPP/CPPScheduler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -98,11 +98,12 @@ void set_thread_affinity(int core_id) return; } +#if !defined(__APPLE__) cpu_set_t set; CPU_ZERO(&set); CPU_SET(core_id, &set); - ARM_COMPUTE_EXIT_ON_MSG(sched_setaffinity(0, sizeof(set), &set), - "Error setting thread affinity"); + ARM_COMPUTE_EXIT_ON_MSG(sched_setaffinity(0, sizeof(set), &set), "Error setting thread affinity"); +#endif /* !defined(__APPLE__) */ } class Thread final diff --git a/src/runtime/CPUUtils.cpp b/src/runtime/CPUUtils.cpp index a7dd464540..74f0f58248 100644 --- a/src/runtime/CPUUtils.cpp +++ b/src/runtime/CPUUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -34,18 +34,18 @@ #include #include -#ifndef BARE_METAL +#if !defined(BARE_METAL) /* C++ std::regex takes up a lot of space in the standalone builds */ #include #include -#endif /* BARE_METAL */ +#endif /* !defined(BARE_METAL) */ -#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) +#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) #include /* Get HWCAP bits from asm/hwcap.h */ #include -#endif /* !BARE_METAL */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ /* Make sure the bits we care about are defined, just in case asm/hwcap.h is * out of date (or for bare metal mode) */ @@ -65,7 +65,7 @@ namespace { using namespace arm_compute; -#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) +#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) bool model_supports_dot(CPUModel model) { @@ -346,7 +346,7 @@ int get_max_cpus() } return max_cpus; } -#endif /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ } // namespace @@ -358,7 +358,7 @@ namespace cpu { void get_cpu_configuration(CPUInfo &cpuinfo) { -#if !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) +#if !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) bool cpuid = false; bool hwcaps_fp16_support = false; bool hwcaps_dot_support = false; @@ -406,9 +406,9 @@ void get_cpu_configuration(CPUInfo &cpuinfo) } cpuinfo.set_dotprod(one_supports_dot || hwcaps_dot_support); cpuinfo.set_fp16(one_supports_fp16 || hwcaps_fp16_support); -#else /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */ +#else /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ ARM_COMPUTE_UNUSED(cpuinfo); -#endif /* !defined(BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && (defined(__arm__) || defined(__aarch64__)) */ } unsigned int get_threads_hint() diff --git a/tests/SConscript b/tests/SConscript index 565aeac4a1..92cf47b5c6 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -73,7 +73,13 @@ test_env.Append(CXXFLAGS = ['-ffp-contract=off']) if 'g++' in test_env['CXX'] and '-Wnoexcept' in test_env['CXXFLAGS']: test_env['CXXFLAGS'].remove("-Wnoexcept") -if env['os'] in ['android', 'bare_metal'] or env['standalone']: +load_whole_archive = '-Wl,--whole-archive' +noload_whole_archive = '-Wl,--no-whole-archive' +if 'macos' in test_env['os']: + load_whole_archive = '-Wl,-force_load' + noload_whole_archive = '-Wl,-noall_load' + +if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: Import("arm_compute_a") Import("arm_compute_core_a") Import("arm_compute_graph_a") @@ -152,7 +158,7 @@ if env['gles_compute']: extra_link_flags = [] if env['os'] == 'android': test_env.Append(LIBS = ["log"]) -elif env['os'] != 'bare_metal': +elif env['os'] not in ['bare_metal', 'macos']: test_env.Append(LIBS = ["rt"]) extra_link_flags += ['-fstack-protector-strong'] @@ -168,7 +174,7 @@ bm_link_flags = [] if test_env['linker_script']: bm_link_flags += ['-Wl,--build-id=none', '-T', env['linker_script']] -if test_env['reference_openmp'] and env['os'] != 'bare_metal': +if test_env['reference_openmp'] and env['os'] not in ['bare_metal', 'macos']: test_env['CXXFLAGS'].append('-fopenmp') test_env['LINKFLAGS'].append('-fopenmp') @@ -215,8 +221,8 @@ if test_env['validation_tests']: graph_utils = test_env.Object(source="../utils/GraphUtils.cpp", target="GraphUtils") for file in Glob("validate_examples/graph_*.cpp"): example = "validate_" + os.path.basename(os.path.splitext(str(file))[0]) - if env['os'] in ['android', 'bare_metal'] or env['standalone']: - prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils]+ files_validate_examples, LIBS = test_env["LIBS"] + [ arm_compute_validation_framework ], LINKFLAGS=test_env["LINKFLAGS"]+['-Wl,--whole-archive',arm_compute_lib,'-Wl,--no-whole-archive'] + bm_link_flags + extra_link_flags) + if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: + prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils]+ files_validate_examples, LIBS = test_env["LIBS"] + [ arm_compute_validation_framework ], LINKFLAGS=test_env["LINKFLAGS"]+[load_whole_archive, arm_compute_lib, noload_whole_archive] + bm_link_flags + extra_link_flags) arm_compute_validate_examples += [ prog ] else: #-Wl,--allow-shlib-undefined: Ignore dependencies of dependencies @@ -267,8 +273,8 @@ if test_env['benchmark_examples']: # Graph examples for file in Glob("%s/graph_*.cpp" % examples_folder ): example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0]) - if env['os'] in ['android', 'bare_metal'] or env['standalone']: - prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils, graph_params]+ files_benchmark_examples, LIBS = test_env["LIBS"], LINKFLAGS=test_env["LINKFLAGS"]+['-Wl,--whole-archive',arm_compute_lib,'-Wl,--no-whole-archive'] + bm_link_flags + extra_link_flags) + if env['os'] in ['android', 'macos', 'bare_metal'] or env['standalone']: + prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils, graph_params]+ files_benchmark_examples, LIBS = test_env["LIBS"], LINKFLAGS=test_env["LINKFLAGS"]+[load_whole_archive, arm_compute_lib, noload_whole_archive] + bm_link_flags + extra_link_flags) arm_compute_benchmark_examples += [ prog ] else: #-Wl,--allow-shlib-undefined: Ignore dependencies of dependencies diff --git a/tests/framework/instruments/Instruments.h b/tests/framework/instruments/Instruments.h index 135810c644..8a6cec0e9c 100644 --- a/tests/framework/instruments/Instruments.h +++ b/tests/framework/instruments/Instruments.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,12 +24,12 @@ #ifndef ARM_COMPUTE_TEST_INSTRUMENTS #define ARM_COMPUTE_TEST_INSTRUMENTS -#if !defined(BARE_METAL) +#if !defined(BARE_METAL) && !defined(__APPLE__) #include "MaliCounter.h" #include "OpenCLMemoryUsage.h" #include "OpenCLTimer.h" #include "PMUCounter.h" -#endif /* !defined(BARE_METAL) */ +#endif /* !defined(BARE_METAL) && !defined(__APPLE__) */ #include "SchedulerTimer.h" #include "WallClockTimer.h" diff --git a/utils/GraphUtils.cpp b/utils/GraphUtils.cpp index bfa28df880..20e1369e73 100644 --- a/utils/GraphUtils.cpp +++ b/utils/GraphUtils.cpp @@ -280,7 +280,8 @@ bool ImageAccessor::access_tensor(ITensor &tensor) #else // __arm__ ARM_COMPUTE_EXIT_ON_MSG_VAR(image_loader->width() != permuted_shape.x() || image_loader->height() != permuted_shape.y(), "Failed to load image file: dimensions [%d,%d] not correct, expected [%" PRIu64 ",%" PRIu64 "].", - image_loader->width(), image_loader->height(), permuted_shape.x(), permuted_shape.y()); + image_loader->width(), image_loader->height(), + static_cast(permuted_shape.x()), static_cast(permuted_shape.y())); #endif // __arm__ // Fill the tensor with the PPM content (BGR) @@ -363,7 +364,8 @@ bool ValidationInputAccessor::access_tensor(arm_compute::ITensor &tensor) #else // __arm__ ARM_COMPUTE_EXIT_ON_MSG_VAR(jpeg.width() != permuted_shape.x() || jpeg.height() != permuted_shape.y(), "Failed to load image file: dimensions [%d,%d] not correct, expected [%" PRIu64 ",%" PRIu64 "].", - jpeg.width(), jpeg.height(), permuted_shape.x(), permuted_shape.y()); + jpeg.width(), jpeg.height(), + static_cast(permuted_shape.x()), static_cast(permuted_shape.y())); #endif // __arm__ // Fill the tensor with the JPEG content (BGR) -- cgit v1.2.1