Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,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'] not in ['android', 'macos', 'openbsd'] else 'clang++'
default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos', 'openbsd', 'freebsd'] else 'clang++'
cpp_compiler = os.environ.get('CXX', default_cpp_compiler)

# Generate embed files
Expand Down
8 changes: 4 additions & 4 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ vars.AddVariables(
allowed_values=("armv7a", "armv7a-hf", "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", "armv8.6-a-sve2-sme2", "armv8r64", "x86")),
EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
EnumVariable("os", "Target OS. With bare metal selected, only Arm® Neon™ (not OpenCL) can be used, static libraries get built and Neon™'s multi-threading support is disabled.", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal", "openbsd","windows", "qnx")),
EnumVariable("os", "Target OS. With bare metal selected, only Arm® Neon™ (not OpenCL) can be used, static libraries get built and Neon™'s multi-threading support is disabled.", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal", "openbsd", "freebsd","windows", "qnx")),
EnumVariable("build", "Either build directly on your device (native) or cross compile from your desktop machine (cross-compile). In both cases make sure the compiler is available in your path.", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")),
BoolVariable("examples", "Build example programs", True),
BoolVariable("gemm_tuner", "Build gemm_tuner programs", True),
Expand Down Expand Up @@ -282,11 +282,11 @@ if env['profile']:

cpp_tool = {'linux': 'g++', 'android' : 'clang++',
'tizen': 'g++', 'macos':'clang++',
'bare_metal':'g++', 'openbsd':'g++','windows':'clang-cl', 'qnx':'qcc -Vgcc_ntoaarch64le'}
'bare_metal':'g++', 'openbsd':'g++', 'freebsd':'clang++', 'windows':'clang-cl', 'qnx':'qcc -Vgcc_ntoaarch64le'}

c_tool = {'linux':'gcc', 'android': 'clang', 'tizen':'gcc',
'macos':'clang','bare_metal':'gcc',
'openbsd':'gcc','windows':'clang-cl', 'qnx':'qcc -Vgcc_ntoaarch64le'}
'openbsd':'gcc', 'freebsd':'clang++', 'windows':'clang-cl', 'qnx':'qcc -Vgcc_ntoaarch64le'}

default_cpp_compiler = cpp_tool[env['os']]
default_c_compiler = c_tool[env['os']]
Expand Down Expand Up @@ -567,7 +567,7 @@ if env['opencl']:
if env["os"] not in ["windows","android", "bare_metal", "qnx"] and (env['opencl'] or env['cppthreads']):
env.Append(LIBS = ['pthread'])

if env['os'] == 'openbsd':
if env['os'] == 'openbsd' or 'freebsd':
env.Append(LIBS = ['c'])
env.Append(CCFLAGS = ['-fPIC'])

Expand Down
1 change: 1 addition & 0 deletions arm_compute/core/utils/misc/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <limits>
#include <numeric>
#include <vector>
#include <cstdint>

namespace arm_compute
{
Expand Down
18 changes: 10 additions & 8 deletions src/common/cpuinfo/CpuInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include <map>
#include <sstream>
#include <sys/types.h>
#include <sys/sysctl.h>

#if !defined(BARE_METAL)
#include <algorithm>
Expand All @@ -52,15 +54,15 @@
#endif /* !defined(BARE_METAL) */

#if !defined(_WIN64)
#if !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
#if !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__) && \
(defined(__arm__) || defined(__aarch64__))
#include <asm/hwcap.h> /* Get HWCAP bits from asm/hwcap.h */
#include <sys/auxv.h>
#elif (defined(__OpenBSD__) || defined(__APPLE__)) && defined(__aarch64__)
#elif (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__)) && defined(__aarch64__)
#include <sys/sysctl.h>
#include <sys/types.h>
#endif /* defined(__APPLE__) && defined(__aarch64__)) */
#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__) && (defined(__arm__) || defined(__aarch64__)) */
#endif /* !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) !defined(__FreeBSD__) && !defined(__QNX__) && (defined(__arm__) || defined(__aarch64__)) */

#define ARM_COMPUTE_CPU_FEATURE_HWCAP_CPUID (1 << 11)
#define ARM_COMPUTE_GET_FEATURE_REG(var, freg) __asm __volatile("MRS %0, " #freg : "=r"(var))
Expand All @@ -70,7 +72,7 @@ namespace cpuinfo
{
namespace
{
#if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
#if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__) && \
(defined(__arm__) || defined(__aarch64__))
/** Extract MIDR using CPUID information that are exposed to user-space
*
Expand Down Expand Up @@ -352,7 +354,7 @@ CpuInfo::CpuInfo(CpuIsaInfo isa, std::vector<CpuModel> cpus) : _isa(std::move(is

CpuInfo CpuInfo::build()
{
#if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
#if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__) && \
(defined(__arm__) || defined(__aarch64__))
const uint32_t hwcaps = getauxval(AT_HWCAP);
const uint32_t hwcaps2 = getauxval(AT_HWCAP2);
Expand Down Expand Up @@ -383,7 +385,7 @@ CpuInfo CpuInfo::build()

CpuInfo info(isa, cpus_model);
return info;
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__) || defined(__FreeBSD__)
int mib[2] = {0, 0};
int ncpu = {1};
size_t len = sizeof(ncpu);
Expand Down Expand Up @@ -420,7 +422,7 @@ CpuInfo CpuInfo::build()
CpuInfo info(isa, cpus_model);
return info;
#elif defined(__aarch64__) && \
(defined(__OpenBSD__) || defined(__APPLE__)) /* #elif(BARE_METAL) && defined(__aarch64__) */
(defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__)) /* #elif(BARE_METAL) && defined(__aarch64__) */
int ncpus = get_hw_capability("hw.perflevel0.logicalcpu");
CpuIsaInfo isainfo;
std::vector<CpuModel> cpus_model(ncpus);
Expand Down Expand Up @@ -466,7 +468,7 @@ CpuModel CpuInfo::cpu_model(uint32_t cpuid) const

CpuModel CpuInfo::cpu_model() const
{
#if defined(_WIN64) || defined(BARE_METAL) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__QNX__) || \
#if defined(_WIN64) || defined(BARE_METAL) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__QNX__) || \
(!defined(__arm__) && !defined(__aarch64__))
return cpu_model(0);
#else /* defined(BARE_METAL) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__QNX__) || (!defined(__arm__) && !defined(__aarch64__)) */
Expand Down
4 changes: 2 additions & 2 deletions src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include "depthfirst_driver.hpp"
#include "src/core/NEON/kernels/arm_conv/addressing.hpp"
#include "utils.hpp"
#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__) */
#include <limits>

namespace arm_conv {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

#include "depthfirst_driver.hpp"
#include "utils.hpp"
#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(FreeBSD) */

namespace arm_conv {
namespace pooling {
Expand Down
4 changes: 2 additions & 2 deletions src/core/NEON/kernels/arm_gemm/gemm_hybrid_indirect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*/
#pragma once

#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__) */

#include <algorithm>
#include <cassert>
Expand Down
4 changes: 2 additions & 2 deletions src/core/NEON/kernels/arm_gemm/interleave-8way.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

#include <arm_neon.h>

#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__) */

#include <cstring>

Expand Down
4 changes: 2 additions & 2 deletions src/core/NEON/kernels/arm_gemm/interleave_indirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "interleave_indirect.hpp"
#include "bfloat.hpp"

#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__) */

#include <algorithm>
#include <cstddef>
Expand Down
4 changes: 2 additions & 2 deletions src/core/NEON/kernels/arm_gemm/transform-bf16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include "src/core/NEON/wrapper/intrinsics/intrinsics.h"
#include "bfloat.hpp"

#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__) */

namespace arm_gemm {

Expand Down
4 changes: 2 additions & 2 deletions src/core/NEON/kernels/arm_gemm/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

#include "bfloat.hpp"

#if !defined(_WIN64) && !defined(__OpenBSD__)
#if !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#include <alloca.h>
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) */
#endif /* !defined(_WIN64) && !defined(__OpenBSD__) && !defined(__FreeBSD__) */

namespace arm_gemm {

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/CPP/CPPScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void set_thread_affinity(int core_id)
return;
}

#if !defined(_WIN64) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__)
#if !defined(_WIN64) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__)
cpu_set_t set;
CPU_ZERO(&set);
CPU_SET(core_id, &set);
Expand Down
2 changes: 2 additions & 0 deletions tests/framework/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "arm_compute/runtime/Scheduler.h"
#include "tests/framework/ParametersLibrary.h"
#include "tests/framework/TestFilter.h"
#include "tests/framework/instruments/OpenCLTimer.h"
#include "tests/framework/instruments/OpenCLMemoryUsage.h"

#ifdef ARM_COMPUTE_CL
#include "arm_compute/runtime/CL/CLRuntimeContext.h"
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/instruments/Instruments.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#ifndef ACL_TESTS_FRAMEWORK_INSTRUMENTS_INSTRUMENTS_H
#define ACL_TESTS_FRAMEWORK_INSTRUMENTS_INSTRUMENTS_H

#if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__)
#if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__)
#include "MaliCounter.h"
#include "OpenCLMemoryUsage.h"
#include "OpenCLTimer.h"
#include "PMUCounter.h"
#endif /* !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__QNX__) */
#endif /* !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__QNX__) */
#include "SchedulerTimer.h"
#include "WallClockTimer.h"

Expand Down