Skip to content

Commit

Permalink
arm_compute v19.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Nov 28, 2019
1 parent 975dfe1 commit 0e205f7
Show file tree
Hide file tree
Showing 11,071 changed files with 340,695 additions and 230,992 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ Tutorials:
- [Tutorial: Cartoonifying Images on Raspberry Pi with the Compute Library](https://community.arm.com/graphics/b/blog/posts/cartoonifying-images-on-raspberry-pi-with-the-compute-library)
- [Tutorial: Running AlexNet on Raspberry Pi with Compute Library](https://community.arm.com/processors/b/blog/posts/running-alexnet-on-raspberry-pi-with-compute-library)

Blogs:

- [Happy Birthday ACL!](https://community.arm.com/developer/tools-software/graphics/b/blog/posts/arm-compute-library-19-05-is-coming)

Documentation available here:
Documentation (API, changelogs, build guide, contribution guide, errata, etc.) available here:

- [v19.11](https://arm-software.github.io/ComputeLibrary/v19.11/)
- [v19.08](https://arm-software.github.io/ComputeLibrary/v19.08/)
- [v19.05](https://arm-software.github.io/ComputeLibrary/v19.05/)
- [v19.02](https://arm-software.github.io/ComputeLibrary/v19.02/)
Expand All @@ -50,6 +47,8 @@ Documentation available here:

Binaries available here:

- [v19.11-linux](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.11/arm_compute-v19.11-bin-linux.tar.gz)
- [v19.11-android](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.11/arm_compute-v19.11-bin-android.tar.gz)
- [v19.08-linux](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.08/arm_compute-v19.08-bin-linux.tar.gz)
- [v19.08-android](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.08/arm_compute-v19.08-bin-android.tar.gz)
- [v19.05-linux](https://github.com/ARM-software/ComputeLibrary/releases/download/v19.05/arm_compute-v19.05-bin-linux.tar.gz)
Expand Down
4 changes: 2 additions & 2 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import os.path
import re
import subprocess

VERSION = "v19.08"
SONAME_VERSION="16.0.0"
VERSION = "v19.11"
SONAME_VERSION="17.0.0"

Import('env')
Import('vars')
Expand Down
28 changes: 15 additions & 13 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ vars.AddVariables(
EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "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),
BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True),
BoolVariable("standalone", "Builds the tests as standalone executables, links statically with libgcc, libstdc++ and libarm_compute", False),
BoolVariable("opencl", "Enable OpenCL support", True),
Expand Down Expand Up @@ -126,11 +127,11 @@ if not env['exceptions']:
env.Append(CPPDEFINES = ['ARM_COMPUTE_EXCEPTIONS_DISABLED'])
env.Append(CXXFLAGS = ['-fno-exceptions'])

env.Append(CXXFLAGS = ['-Wno-deprecated-declarations','-Wall','-DARCH_ARM',
'-Wextra','-Wno-unused-parameter','-pedantic','-Wdisabled-optimization','-Wformat=2',
env.Append(CXXFLAGS = ['-Wall','-DARCH_ARM',
'-Wextra','-pedantic','-Wdisabled-optimization','-Wformat=2',
'-Winit-self','-Wstrict-overflow=2','-Wswitch-default',
'-fpermissive','-std=gnu++11','-Wno-vla','-Woverloaded-virtual',
'-Wctor-dtor-privacy','-Wsign-promo','-Weffc++','-Wno-format-nonliteral','-Wno-overlength-strings','-Wno-strict-overflow'])
'-fpermissive','-std=gnu++11','-Woverloaded-virtual', '-Wformat-security',
'-Wctor-dtor-privacy','-Wsign-promo','-Weffc++','-Wno-overlength-strings'])

env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])

Expand All @@ -143,9 +144,11 @@ if env['os'] == 'android' and ( 'clang++' not in cpp_compiler or 'clang' not in
print( "WARNING: Only clang is officially supported to build the Compute Library for Android")

if 'clang++' in cpp_compiler:
env.Append(CXXFLAGS = ['-Wno-format-nonliteral','-Wno-deprecated-increment-bool','-Wno-vla-extension','-Wno-mismatched-tags'])
env.Append(CXXFLAGS = ['-Wno-vla-extension'])
elif 'armclang' in cpp_compiler:
pass
else:
env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel', '-Wno-redundant-move'])
env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel'])

if env['cppthreads']:
env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
Expand All @@ -159,6 +162,7 @@ if env['openmp']:
env.Append(CXXFLAGS = ['-fopenmp'])
env.Append(LINKFLAGS = ['-fopenmp'])

# Add architecture specific flags
prefix = ""
if env['arch'] == 'armv7a':
env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
Expand All @@ -174,15 +178,13 @@ if env['arch'] == 'armv7a':
env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
elif env['arch'] == 'arm64-v8a':
env.Append(CXXFLAGS = ['-march=armv8-a'])
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8A','NO_DOT_IN_TOOLCHAIN'])
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8A'])
if env['os'] == 'linux':
prefix = "aarch64-linux-gnu-"
elif env['os'] == 'bare_metal':
prefix = "aarch64-elf-"
elif env['os'] == 'android':
prefix = "aarch64-linux-android-"
if 'clang++' in cpp_compiler:
env.Append(CXXFLAGS = ['-no-integrated-as'])
elif 'arm64-v8.2-a' in env['arch']:
if env['arch'] == 'arm64-v8.2-a-sve':
env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
Expand All @@ -194,9 +196,7 @@ elif 'arm64-v8.2-a' in env['arch']:
prefix = "aarch64-elf-"
elif env['os'] == 'android':
prefix = "aarch64-linux-android-"
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8_2','NO_DOT_IN_TOOLCHAIN'])
if 'clang++' in cpp_compiler:
env.Append(CXXFLAGS = ['-no-integrated-as'])
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8_2'])
elif env['arch'] == 'x86_32':
env.Append(CCFLAGS = ['-m32'])
env.Append(LINKFLAGS = ['-m32'])
Expand Down Expand Up @@ -225,7 +225,9 @@ if not GetOption("help"):
print("ERROR: Compiler '%s' not found" % env['CXX'])
Exit(1)

if 'clang++' not in cpp_compiler:
if 'armclang' in cpp_compiler:
pass
elif 'clang++' not in cpp_compiler:
if env['arch'] == 'arm64-v8.2-a' and not version_at_least(compiler_ver, '6.2.1'):
print("GCC 6.2.1 or newer is required to compile armv8.2-a code")
Exit(1)
Expand Down
75 changes: 75 additions & 0 deletions arm_compute/core/CL/CLCoreRuntimeContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright (c) 2019 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.
*/
#ifndef __ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__
#define __ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__

#include "arm_compute/core/CL/OpenCL.h"

namespace arm_compute
{
// Forward declarations
class CLKernelLibrary;

/** Core runtime context for OpenCL */
class CLCoreRuntimeContext final
{
public:
/** Legacy constructor */
CLCoreRuntimeContext();

/** Constructor */
CLCoreRuntimeContext(CLKernelLibrary *kernel_lib, cl::Context ctx, cl::CommandQueue queue);
/** Destructor */
~CLCoreRuntimeContext() = default;
/** Default copy constructor */
CLCoreRuntimeContext(const CLCoreRuntimeContext &) = default;
/** Default move constructor */
CLCoreRuntimeContext(CLCoreRuntimeContext &&) = default;
/** Default copy assignment */
CLCoreRuntimeContext &operator=(const CLCoreRuntimeContext &) = default;
/** Default move assignment operator */
CLCoreRuntimeContext &operator=(CLCoreRuntimeContext &&) = default;
/** Kernel Library accessor
*
* @return The kernel library instance used by the core context
*/
CLKernelLibrary *kernel_library() const;
/** OpenCL context accessor
*
* @return The OpenCL context used by the core context
*/
cl::Context context();
/** OpenCL command queue accessor
*
* @return The OpenCL queue used by the core context
*/
cl::CommandQueue queue();

private:
CLKernelLibrary *_kernel_lib{ nullptr };
cl::Context _ctx{};
cl::CommandQueue _queue{};
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_CLCORERUNTIME_CONTEXT_H__ */
31 changes: 30 additions & 1 deletion arm_compute/core/CL/CLHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

namespace arm_compute
{
class CLCoreRuntimeContext;
class CLBuildOptions;

enum class DataType;

/** Max vector width of an OpenCL vector */
Expand All @@ -47,6 +50,22 @@ static constexpr unsigned int max_cl_vector_width = 16;
*/
std::string get_cl_type_from_data_type(const DataType &dt);

/** Translates a tensor data type to the appropriate OpenCL promoted type.
*
* @param[in] dt @ref DataType to be used to get the promoted OpenCL type.
*
* @return The string specifying the OpenCL type to be used.
*/
std::string get_cl_promoted_type_from_data_type(const DataType &dt);

/** Translates the element size to an unsigned integer data type
*
* @param[in] element_size Size in bytes of an element.
*
* @return The string specifying the OpenCL type to be used.
*/
std::string get_cl_unsigned_type_from_element_size(size_t element_size);

/** Translates a tensor data type to the appropriate OpenCL select type.
*
* @param[in] dt @ref DataType to be translated to OpenCL select type.
Expand Down Expand Up @@ -153,5 +172,15 @@ size_t preferred_vector_width(const cl::Device &device, DataType dt);
* @return True if dummy work-items should be preferred to dispatch the NDRange
*/
bool preferred_dummy_work_items_support(const cl::Device &device);
}

/** Creates an opencl kernel
*
* @param[in] ctx A context to be used to create the opencl kernel.
* @param[in] kernel_name The kernel name.
* @param[in] build_opts The build options to be used for the opencl kernel compilation.
*
* @return An opencl kernel
*/
cl::Kernel create_opencl_kernel(CLCoreRuntimeContext *ctx, const std::string &kernel_name, const CLBuildOptions &build_opts);
} // namespace arm_compute
#endif /* __ARM_COMPUTE_CLHELPERS_H__ */
Loading

0 comments on commit 0e205f7

Please sign in to comment.