diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/armnn/BackendId.hpp | 18 | ||||
-rw-r--r-- | include/armnn/BackendOptions.hpp | 6 | ||||
-rw-r--r-- | include/armnn/BackendRegistry.hpp | 2 | ||||
-rw-r--r-- | include/armnn/DescriptorsFwd.hpp | 2 | ||||
-rw-r--r-- | include/armnn/Exceptions.hpp | 6 | ||||
-rw-r--r-- | include/armnn/IRuntime.hpp | 10 | ||||
-rw-r--r-- | include/armnn/LayerVisitorBase.hpp | 2 | ||||
-rw-r--r-- | include/armnn/Optional.hpp | 60 | ||||
-rw-r--r-- | include/armnn/Tensor.hpp | 4 | ||||
-rw-r--r-- | include/armnn/Types.hpp | 8 | ||||
-rw-r--r-- | include/armnn/Version.hpp | 12 | ||||
-rw-r--r-- | include/armnn/backends/IBackendContext.hpp | 4 | ||||
-rw-r--r-- | include/armnn/backends/IBackendInternal.hpp | 10 | ||||
-rw-r--r-- | include/armnn/backends/ITensorHandle.hpp | 2 | ||||
-rw-r--r-- | include/armnn/backends/ITensorHandleFactory.hpp | 10 | ||||
-rw-r--r-- | include/armnnUtils/DataLayoutIndexed.hpp | 12 | ||||
-rw-r--r-- | include/armnnUtils/FloatingPointConverter.hpp | 4 |
17 files changed, 88 insertions, 84 deletions
diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp index 36f298741c..c94cd66661 100644 --- a/include/armnn/BackendId.hpp +++ b/include/armnn/BackendId.hpp @@ -14,10 +14,10 @@ namespace armnn { -// -// The Compute enum is now deprecated and it is now -// being replaced by BackendId -// +/// +/// The Compute enum is now deprecated and it is now +/// being replaced by BackendId +/// enum class Compute { Undefined = 0, @@ -111,8 +111,8 @@ public: return m_Id == other.m_Id; } - // comparison against objects from which the - // BackendId can be constructed + /// comparison against objects from which the + /// BackendId can be constructed template <typename O> bool operator==(const O& other) const { @@ -147,9 +147,9 @@ private: namespace std { -// make BackendId compatible with std hashtables by reusing the hash -// function for strings. -// Note this must come *before* the first use of unordered_set<BackendId>. +/// make BackendId compatible with std hashtables by reusing the hash +/// function for strings. +/// Note this must come *before* the first use of unordered_set<BackendId>. template <> struct hash<armnn::BackendId> { diff --git a/include/armnn/BackendOptions.hpp b/include/armnn/BackendOptions.hpp index a1b6b09cad..d7ccbd4b57 100644 --- a/include/armnn/BackendOptions.hpp +++ b/include/armnn/BackendOptions.hpp @@ -27,7 +27,7 @@ private: }; public: - // Very basic type safe variant + /// Very basic type safe variant class Var { @@ -39,7 +39,7 @@ public: explicit Var(const char* s) : m_Vals(s), m_Type(VarTypes::String) {}; explicit Var(std::string s) : m_Vals(s), m_Type(VarTypes::String) {}; - //Disallow implicit conversions from types not explicitly allowed below. + /// Disallow implicit conversions from types not explicitly allowed below. template<typename DisallowedType> Var(DisallowedType) { @@ -161,7 +161,7 @@ public: String, }; - // Union of potential type values. + /// Union of potential type values. union Vals { int i; diff --git a/include/armnn/BackendRegistry.hpp b/include/armnn/BackendRegistry.hpp index a0cfee9391..1aaa11c55c 100644 --- a/include/armnn/BackendRegistry.hpp +++ b/include/armnn/BackendRegistry.hpp @@ -48,7 +48,7 @@ public: protected: using FactoryStorage = std::unordered_map<BackendId, FactoryFunction>; - // For testing only + /// For testing only static void Swap(BackendRegistry& instance, FactoryStorage& other); private: diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp index 144c1ef7fd..1298c1ce01 100644 --- a/include/armnn/DescriptorsFwd.hpp +++ b/include/armnn/DescriptorsFwd.hpp @@ -46,7 +46,7 @@ struct ViewsDescriptor; using ConcatDescriptor = OriginsDescriptor; using DepthToSpaceDescriptor = SpaceToDepthDescriptor; using LogSoftmaxDescriptor = SoftmaxDescriptor; -// MergerDescriptor is deprecated, use ConcatDescriptor instead +/// MergerDescriptor is deprecated, use ConcatDescriptor instead using MergerDescriptor = OriginsDescriptor; using SplitterDescriptor = ViewsDescriptor; diff --git a/include/armnn/Exceptions.hpp b/include/armnn/Exceptions.hpp index 05b740614d..a83e31a71e 100644 --- a/include/armnn/Exceptions.hpp +++ b/include/armnn/Exceptions.hpp @@ -48,12 +48,12 @@ class Exception : public std::exception public: explicit Exception(const std::string& message); - // exception with context + /// exception with context explicit Exception(const std::string& message, const CheckLocation& location); - // preserving previous exception context - // and adding local context information + /// preserving previous exception context + /// and adding local context information explicit Exception(const Exception& other, const std::string& message, const CheckLocation& location); diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index 49c18113b3..712355bb3a 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -50,11 +50,11 @@ public: /// It will also be updated with new tuned parameters if it is configured to do so. std::shared_ptr<IGpuAccTunedParameters> m_GpuAccTunedParameters; - // Setting this flag will allow the user to obtain GPU profiling information from the runtime. + /// Setting this flag will allow the user to obtain GPU profiling information from the runtime. bool m_EnableGpuProfiling; - // Setting this value will override the paths set by the DYNAMIC_BACKEND_PATHS compiler directive - // Only a single path is allowed for the override + /// Setting this value will override the paths set by the DYNAMIC_BACKEND_PATHS compiler directive + /// Only a single path is allowed for the override std::string m_DynamicBackendsPath; struct ExternalProfilingOptions @@ -78,6 +78,7 @@ public: /// Pass backend specific options. /// /// For example, to enable GpuAcc tuning add the following + /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.cpp /// m_BackendOption.emplace_back( /// BackendOptions{"GpuAcc", /// { @@ -85,16 +86,19 @@ public: /// {"TuningFile", filename} /// } /// }); + /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// Execute representative workloads through the runtime to generate tuning data. /// The tuning file is written once the runtime is destroyed /// To execute with the tuning data, start up with just the tuning file specified. + /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.cpp /// m_BackendOption.emplace_back( /// BackendOptions{"GpuAcc", /// { /// {"TuningFile", filename} /// } /// }); + /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// The following backend options are available: /// GpuAcc: diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp index 511917cd19..9335ff8b0b 100644 --- a/include/armnn/LayerVisitorBase.hpp +++ b/include/armnn/LayerVisitorBase.hpp @@ -20,7 +20,7 @@ struct VisitorNoThrowPolicy static void Apply(const std::string&) {} }; -// Visitor base class with empty implementations. +/// Visitor base class with empty implementations. template<typename DefaultPolicy> class LayerVisitorBase : public ILayerVisitor { diff --git a/include/armnn/Optional.hpp b/include/armnn/Optional.hpp index 863b122716..677152636a 100644 --- a/include/armnn/Optional.hpp +++ b/include/armnn/Optional.hpp @@ -9,30 +9,30 @@ #include <cstring> #include <type_traits> -// Optional is a drop in replacement for std::optional until we migrate -// to c++-17. Only a subset of the optional features are implemented that -// we intend to use in ArmNN. +/// Optional is a drop in replacement for std::optional until we migrate +/// to c++-17. Only a subset of the optional features are implemented that +/// we intend to use in ArmNN. -// There are two distinct implementations here: -// -// 1, for normal constructable/destructable types and reference types -// 2, for reference types +/// There are two distinct implementations here: +/// +/// 1, for normal constructable/destructable types and reference types +/// 2, for reference types -// The std::optional features we support are: -// -// - has_value() and operator bool() to tell if the optional has a value -// - value() returns a reference to the held object -// +/// The std::optional features we support are: +/// +/// - has_value() and operator bool() to tell if the optional has a value +/// - value() returns a reference to the held object +/// namespace armnn { -// EmptyOptional is used to initialize the Optional class in case we want -// to have default value for an Optional in a function declaration. +/// EmptyOptional is used to initialize the Optional class in case we want +/// to have default value for an Optional in a function declaration. struct EmptyOptional {}; -// Disambiguation tag that can be passed to the constructor to indicate that -// the contained object should be constructed in-place +/// Disambiguation tag that can be passed to the constructor to indicate that +/// the contained object should be constructed in-place struct ConstructInPlace { explicit ConstructInPlace() = default; @@ -40,8 +40,8 @@ struct ConstructInPlace #define CONSTRUCT_IN_PLACE armnn::ConstructInPlace{} -// OptionalBase is the common functionality between reference and non-reference -// optional types. +/// OptionalBase is the common functionality between reference and non-reference +/// optional types. class OptionalBase { public: @@ -72,11 +72,11 @@ protected: bool m_HasValue; }; -// -// The default implementation is the non-reference case. This -// has an unsigned char array for storing the optional value which -// is in-place constructed there. -// +/// +/// The default implementation is the non-reference case. This +/// has an unsigned char array for storing the optional value which +/// is in-place constructed there. +/// template <bool IsReference, typename T> class OptionalReferenceSwitch : public OptionalBase { @@ -182,11 +182,11 @@ private: alignas(alignof(T)) unsigned char m_Storage[sizeof(T)]; }; -// -// This is the special case for reference types. This holds a pointer -// to the referenced type. This doesn't own the referenced memory and -// it never calls delete on the pointer. -// +/// +/// This is the special case for reference types. This holds a pointer +/// to the referenced type. This doesn't own the referenced memory and +/// it never calls delete on the pointer. +/// template <typename T> class OptionalReferenceSwitch<true, T> : public OptionalBase { @@ -298,8 +298,8 @@ public: } }; -// Utility template that constructs an object of type T in-place and wraps -// it inside an Optional<T> object +/// Utility template that constructs an object of type T in-place and wraps +/// it inside an Optional<T> object template<typename T, class... Args> Optional<T> MakeOptional(Args&&... args) { diff --git a/include/armnn/Tensor.hpp b/include/armnn/Tensor.hpp index d41cbb4b70..012b950004 100644 --- a/include/armnn/Tensor.hpp +++ b/include/armnn/Tensor.hpp @@ -177,8 +177,8 @@ public: MemoryType GetMemoryArea() const { return m_MemoryArea; } protected: - // Protected destructor to stop users from making these - // (could still new one on the heap and then leak it...) + /// Protected destructor to stop users from making these + /// (could still new one on the heap and then leak it...) ~BaseTensor() {} MemoryType m_MemoryArea; diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp index 29a0d4e364..9779958ee0 100644 --- a/include/armnn/Types.hpp +++ b/include/armnn/Types.hpp @@ -17,7 +17,7 @@ namespace armnn constexpr unsigned int MaxNumOfTensorDimensions = 5U; -// The lowest performance data capture interval we support is 10 miliseconds. +/// The lowest performance data capture interval we support is 10 miliseconds. constexpr unsigned int LOWEST_CAPTURE_PERIOD = 10000u; /// @enum Status enumeration @@ -308,7 +308,7 @@ struct ProfilingStaticGuid : public ProfilingGuid namespace std { -// make ProfilingGuid hashable +/// make ProfilingGuid hashable template<> struct hash<armnn::profiling::ProfilingGuid> { @@ -318,7 +318,7 @@ struct hash<armnn::profiling::ProfilingGuid> } }; -// make ProfilingDynamicGuid hashable +/// make ProfilingDynamicGuid hashable template<> struct hash<armnn::profiling::ProfilingDynamicGuid> { @@ -328,7 +328,7 @@ struct hash<armnn::profiling::ProfilingDynamicGuid> } }; -// make ProfilingStaticGuid hashable +/// make ProfilingStaticGuid hashable template<> struct hash<armnn::profiling::ProfilingStaticGuid> { diff --git a/include/armnn/Version.hpp b/include/armnn/Version.hpp index 7a8553704f..1b76a0614a 100644 --- a/include/armnn/Version.hpp +++ b/include/armnn/Version.hpp @@ -5,7 +5,7 @@ #pragma once -// Macro utils +/// Macro utils #define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s) #define STRINGIFY_MACRO(s) #s #define CONCAT_VALUE(a, b, c) CONCAT_MACRO(a, b, c) @@ -16,9 +16,9 @@ #define ARMNN_MINOR_VERSION 02 #define ARMNN_PATCH_VERSION 00 -// ARMNN_VERSION: "YYYYMMPP" -// where: -// YYYY = 4-digit year number -// MM = 2-digit month number -// PP = 2-digit patch number +/// ARMNN_VERSION: "YYYYMMPP" +/// where: +/// YYYY = 4-digit year number +/// MM = 2-digit month number +/// PP = 2-digit patch number #define ARMNN_VERSION "20" STRINGIFY_VALUE(CONCAT_VALUE(ARMNN_MAJOR_VERSION, ARMNN_MINOR_VERSION, ARMNN_PATCH_VERSION)) diff --git a/include/armnn/backends/IBackendContext.hpp b/include/armnn/backends/IBackendContext.hpp index de9824956f..b12c99f733 100644 --- a/include/armnn/backends/IBackendContext.hpp +++ b/include/armnn/backends/IBackendContext.hpp @@ -16,11 +16,11 @@ protected: IBackendContext(const IRuntime::CreationOptions&) {} public: - // Before and after Load network events + /// Before and after Load network events virtual bool BeforeLoadNetwork(NetworkId networkId) = 0; virtual bool AfterLoadNetwork(NetworkId networkId) = 0; - // Before and after Unload network events + /// Before and after Unload network events virtual bool BeforeUnloadNetwork(NetworkId networkId) = 0; virtual bool AfterUnloadNetwork(NetworkId networkId) = 0; diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp index 6ad9bba546..6771e7b9f5 100644 --- a/include/armnn/backends/IBackendInternal.hpp +++ b/include/armnn/backends/IBackendInternal.hpp @@ -68,18 +68,18 @@ inline std::ostream& operator<<(std::ostream& os, const BackendVersion& backendV class IBackendInternal : public IBackend { protected: - // Creation must be done through a specific - // backend interface. + /// Creation must be done through a specific + /// backend interface. IBackendInternal() = default; public: - // Allow backends created by the factory function - // to be destroyed through IBackendInternal. + /// Allow backends created by the factory function + /// to be destroyed through IBackendInternal. ~IBackendInternal() override = default; using IWorkloadFactoryPtr = std::unique_ptr<IWorkloadFactory>; using IBackendContextPtr = std::unique_ptr<IBackendContext>; - // This is the bridge between backend and backend profiling we'll keep it in the backend namespace. + /// This is the bridge between backend and backend profiling we'll keep it in the backend namespace. using IBackendProfilingContextPtr = std::shared_ptr<armnn::profiling::IBackendProfilingContext>; using IBackendProfilingPtr = std::unique_ptr<armnn::profiling::IBackendProfiling>; using OptimizationPtr = std::unique_ptr<Optimization>; diff --git a/include/armnn/backends/ITensorHandle.hpp b/include/armnn/backends/ITensorHandle.hpp index 73b902eb7c..3002115957 100644 --- a/include/armnn/backends/ITensorHandle.hpp +++ b/include/armnn/backends/ITensorHandle.hpp @@ -61,7 +61,7 @@ public: /// \return a TensorShape filled with the number of elements for each dimension. virtual TensorShape GetShape() const = 0; - // Testing support to be able to verify and set tensor data content + /// Testing support to be able to verify and set tensor data content virtual void CopyOutTo(void* memory) const = 0; virtual void CopyInFrom(const void* memory) = 0; diff --git a/include/armnn/backends/ITensorHandleFactory.hpp b/include/armnn/backends/ITensorHandleFactory.hpp index 03abe18aa9..cd094d2783 100644 --- a/include/armnn/backends/ITensorHandleFactory.hpp +++ b/include/armnn/backends/ITensorHandleFactory.hpp @@ -19,8 +19,8 @@ class ITensorHandleFactory { public: using FactoryId = std::string; - static const FactoryId LegacyFactoryId; // Use the workload factory to create the tensor handle - static const FactoryId DeferredFactoryId; // Some TensorHandleFactory decisions are deferred to run-time + static const FactoryId LegacyFactoryId; /// Use the workload factory to create the tensor handle + static const FactoryId DeferredFactoryId; /// Some TensorHandleFactory decisions are deferred to run-time virtual ~ITensorHandleFactory() {} @@ -33,9 +33,9 @@ public: virtual std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo, DataLayout dataLayout) const = 0; - // Utility Functions for backends which require TensorHandles to have unmanaged memory. - // These should be overloaded if required to facilitate direct import of input tensors - // and direct export of output tensors. + /// Utility Functions for backends which require TensorHandles to have unmanaged memory. + /// These should be overloaded if required to facilitate direct import of input tensors + /// and direct export of output tensors. virtual std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo, const bool IsMemoryManaged) const { diff --git a/include/armnnUtils/DataLayoutIndexed.hpp b/include/armnnUtils/DataLayoutIndexed.hpp index 03404bda5d..c6701f7d5c 100644 --- a/include/armnnUtils/DataLayoutIndexed.hpp +++ b/include/armnnUtils/DataLayoutIndexed.hpp @@ -13,7 +13,7 @@ namespace armnnUtils { -// Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout +/// Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout class DataLayoutIndexed { public: @@ -36,25 +36,25 @@ public: BOOST_ASSERT( widthIndex < shape[m_WidthIndex] || ( shape[m_WidthIndex] == 0 && widthIndex == 0) ); - // Offset the given indices appropriately depending on the data layout + /// Offset the given indices appropriately depending on the data layout switch (m_DataLayout) { case armnn::DataLayout::NHWC: batchIndex *= shape[1] * shape[2] * shape[3]; // batchIndex *= heightIndex * widthIndex * channelIndex heightIndex *= shape[m_WidthIndex] * shape[m_ChannelsIndex]; widthIndex *= shape[m_ChannelsIndex]; - // channelIndex stays unchanged + /// channelIndex stays unchanged break; case armnn::DataLayout::NCHW: default: batchIndex *= shape[1] * shape[2] * shape[3]; // batchIndex *= heightIndex * widthIndex * channelIndex channelIndex *= shape[m_HeightIndex] * shape[m_WidthIndex]; heightIndex *= shape[m_WidthIndex]; - // widthIndex stays unchanged + /// widthIndex stays unchanged break; } - // Get the value using the correct offset + /// Get the value using the correct offset return batchIndex + channelIndex + heightIndex + widthIndex; } @@ -65,7 +65,7 @@ private: unsigned int m_WidthIndex; }; -// Equality methods +/// Equality methods bool operator==(const armnn::DataLayout& dataLayout, const DataLayoutIndexed& indexed); bool operator==(const DataLayoutIndexed& indexed, const armnn::DataLayout& dataLayout); diff --git a/include/armnnUtils/FloatingPointConverter.hpp b/include/armnnUtils/FloatingPointConverter.hpp index a2244735dc..68c24cdc6e 100644 --- a/include/armnnUtils/FloatingPointConverter.hpp +++ b/include/armnnUtils/FloatingPointConverter.hpp @@ -13,8 +13,8 @@ namespace armnnUtils class FloatingPointConverter { public: - // Converts a buffer of FP32 values to FP16, and stores in the given dstFloat16Buffer. - // dstFloat16Buffer should be (numElements * 2) in size + /// Converts a buffer of FP32 values to FP16, and stores in the given dstFloat16Buffer. + /// dstFloat16Buffer should be (numElements * 2) in size static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer); static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer); |