Skip to content

Commit

Permalink
arm_compute v17.03.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyBarbier committed Mar 24, 2017
1 parent e8f6d10 commit 2ceff81
Show file tree
Hide file tree
Showing 4,131 changed files with 481,228 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
48 changes: 48 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
Language: Cpp
AccessModifierOffset: '0'
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlinesLeft: 'true'
AlignTrailingComments: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'true'
AlwaysBreakTemplateDeclarations: 'true'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: 'false'
BreakConstructorInitializersBeforeComma: 'false'
#BreakStringLiterals: 'true'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
IndentCaseLabels: 'true'
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: None
PointerAlignment: Right
SortIncludes: 'true'
SpaceAfterCStyleCast: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: Never
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '4'
UseTab: Never
ReflowComments: 'false'
ContinuationIndentWidth: '4'
ColumnLimit: 0
---
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

Please report issues here: https://github.com/ARM-software/ComputeLibrary/issues

Documentation available here: [v17.03.1](https://arm-software.github.io/ComputeLibrary/v17.03.1/)

Support: [email protected]

23 changes: 23 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2016, 2017 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.

SConscript('sconscript', variant_dir='build', duplicate=0)
72 changes: 72 additions & 0 deletions arm_compute/core/AccessWindowAutoPadding.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (c) 2017 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_ACCESS_WINDOW_AUTO_PADDING_H__
#define __ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__

#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/IAccessWindow.h"
#include "arm_compute/core/TensorShape.h"
#include "arm_compute/core/Types.h"

namespace arm_compute
{
class Window;
class TensorInfo;

/** Dummy access window.
*
* This implementation always uses the auto padding of the tensor info and
* never updates the window. The valid region is always set to cover the entire
* tensor.
*
* @note This access window is only used during the migration to the new
* padding system. It will be removed once all kernels have been ported.
*
* */
class AccessWindowAutoPadding : public IAccessWindow
{
public:
/** Default constructor.
*
* @param[in,out] info Tensor info of the accessed kernel.
*/
AccessWindowAutoPadding(TensorInfo *info);
AccessWindowAutoPadding(const AccessWindowAutoPadding &) = delete;
AccessWindowAutoPadding &operator=(const AccessWindowAutoPadding &) = delete;
AccessWindowAutoPadding(AccessWindowAutoPadding &&) = default;
AccessWindowAutoPadding &operator=(AccessWindowAutoPadding &&) = default;
~AccessWindowAutoPadding() = default;

void set_valid_region();

// Inherited methods overridden:
bool update_window_if_needed(Window &window) const override;
bool update_padding_if_needed(const Window &window) const override;
void set_valid_region(const Window &window, ValidRegion input_valid_region, bool border_undefined, BorderSize border_size) override;

private:
TensorInfo *_info;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_ACCESS_WINDOW_AUTO_PADDING_H__*/
78 changes: 78 additions & 0 deletions arm_compute/core/AccessWindowStatic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2017 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_IACCESS_WINDOW_STATIC_H__
#define __ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__

#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/IAccessWindow.h"
#include "arm_compute/core/TensorShape.h"
#include "arm_compute/core/Types.h"

#include <array>

namespace arm_compute
{
class Window;
class TensorInfo;

/** Implementation of a static rectangular access pattern.
*
* In this implementation the access offsets and sizes are not relative to the
* current element. Instead they are considered to be absolute coordinates
* within the accessed tensor's shape.
*
* */
class AccessWindowStatic : public IAccessWindow
{
public:
/** Constructor for a static access pattern.
*
* @param[in,out] info Tensor info of the accessed kernel.
* @param[in] start_x Start of the access in X direction.
* @param[in] start_y Start of the access in Y direction.
* @param[in] end_x End of the access in X direction.
* @param[in] end_y End of the access in Y direction.
*/
AccessWindowStatic(TensorInfo *info, int start_x, int start_y, int end_x, int end_y);

AccessWindowStatic(const AccessWindowStatic &) = delete;
AccessWindowStatic &operator=(const AccessWindowStatic &) = delete;
AccessWindowStatic(AccessWindowStatic &&) = default;
AccessWindowStatic &operator=(AccessWindowStatic &&) = default;
~AccessWindowStatic() = default;

// Inherited methods overriden:
bool update_window_if_needed(Window &window) const override;
bool update_padding_if_needed(const Window &window) const override;
void set_valid_region(const Window &window, ValidRegion input_valid_region);
void set_valid_region(const Window &window, ValidRegion input_valid_region, bool border_undefined, BorderSize border_size) override;

TensorInfo *_info;
int _start_x;
int _start_y;
int _end_x;
int _end_y;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_IACCESS_WINDOW_STATIC_H__*/
48 changes: 48 additions & 0 deletions arm_compute/core/AccessWindowTranspose.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2017 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_IACCESS_WINDOW_TRANSPOSE_H__
#define __ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__

#include "arm_compute/core/Coordinates.h"
#include "arm_compute/core/IAccessWindow.h"
#include "arm_compute/core/TensorShape.h"
#include "arm_compute/core/Types.h"

namespace arm_compute
{
class Window;
class TensorInfo;

/** Implementation of a XY-transpose access pattern. */
class AccessWindowTranspose : public AccessWindowRectangle
{
public:
using AccessWindowRectangle::AccessWindowRectangle;
bool update_window_if_needed(Window &window) const override;
bool update_padding_if_needed(const Window &window) const override;
using AccessWindowRectangle::set_valid_region;
void set_valid_region(const Window &window, ValidRegion input_valid_region, bool border_undefined, BorderSize border_size) override;
};
} // namespace arm_compute
#endif /*__ARM_COMPUTE_IACCESS_WINDOW_TRANSPOSE_H__*/
44 changes: 44 additions & 0 deletions arm_compute/core/CL/CLHelpers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2016, 2017 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_CLHELPERS_H__
#define __ARM_COMPUTE_CLHELPERS_H__

#include <string>

namespace arm_compute
{
enum class DataType;

/** Max vector width of an OpenCL vector */
static constexpr const unsigned int max_cl_vector_width = 16;

/** Translates a tensor data type to the appropriate OpenCL type.
*
* @param[in] dt @ref DataType to be translated to OpenCL type.
*
* @return The string specifying the OpenCL type to be used.
*/
std::string get_cl_type_from_data_type(const DataType &dt);
}
#endif
Loading

0 comments on commit 2ceff81

Please sign in to comment.