aboutsummaryrefslogtreecommitdiff
path: root/arm_compute
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute')
-rw-r--r--arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h4
-rw-r--r--arm_compute/runtime/GLES_COMPUTE/GCMemoryGroup.h2
-rw-r--r--arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h17
-rw-r--r--arm_compute/runtime/MemoryGroupBase.h8
4 files changed, 19 insertions, 12 deletions
diff --git a/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h b/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h
index 103ac37bdd..8fa13e59a6 100644
--- a/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h
+++ b/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h
@@ -33,7 +33,7 @@
namespace arm_compute
{
-/** Default gles buffer allocator implementation */
+/** Default GLES buffer allocator implementation */
class GCBufferAllocator : public IAllocator
{
public:
@@ -44,5 +44,5 @@ public:
void *allocate(size_t size, size_t alignment) override;
void free(void *ptr) override;
};
-} // arm_compute
+} // namespace arm_compute
#endif /*__ARM_COMPUTE_GCBUFFERALLOCATOR_H__ */
diff --git a/arm_compute/runtime/GLES_COMPUTE/GCMemoryGroup.h b/arm_compute/runtime/GLES_COMPUTE/GCMemoryGroup.h
index 485aa0e024..10f4fc6b05 100644
--- a/arm_compute/runtime/GLES_COMPUTE/GCMemoryGroup.h
+++ b/arm_compute/runtime/GLES_COMPUTE/GCMemoryGroup.h
@@ -44,5 +44,5 @@ inline void MemoryGroupBase<GCTensor>::associate_memory_group(GCTensor *obj)
ARM_COMPUTE_ERROR_ON(allocator == nullptr);
allocator->set_associated_memory_group(this);
}
-} // arm_compute
+} // namespace arm_compute
#endif /*__ARM_COMPUTE_GCMEMORYGROUP_H__ */
diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h
index 81be1de21a..1f8dc3e1a0 100644
--- a/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h
+++ b/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h
@@ -67,14 +67,17 @@ public:
GCFullyConnectedLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
/** Set the input and output tensors.
*
- * @param[in] input Source tensor. Data type supported: F16/F32.
- * @param[in] weights Weights tensor. The weights must be 2 dimensional. Data type supported: Same as @p input
- * @param[in] biases Bias tensor. It can be nullptr. Data type supported:Same as @p input.
- * @param[out] output Destination tensor. Data type supported: Same as @p input.
- * @param[in] transpose_weights (Optional) Transpose weights if true. Defaults to true.
- * @param[in] are_weights_reshaped (Optional) Reshape the weights tensor if false. Defaults to false.
+ * @param[in] input Source tensor. Data type supported: F16/F32.
+ * @param[in] weights Weights tensor. The weights must be 2 dimensional. Data type supported: Same as @p input
+ * @param[in] biases Bias tensor. It can be nullptr. Data type supported:Same as @p input.
+ * @param[out] output Destination tensor. Data type supported: Same as @p input.
+ * @param[in] transpose_weights (Optional) Transpose weights if true. Defaults to true.
+ * @param[in] are_weights_reshaped (Optional) Reshape the weights tensor if false. Defaults to false.
+ * @param[in] retain_internal_weights (Optional) Retain internal reshaped weights. Defaults to false.
+ * Used for reconfiguration purposes.
*/
- void configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, bool transpose_weights = true, bool are_weights_reshaped = false);
+ void configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output,
+ bool transpose_weights = true, bool are_weights_reshaped = false, bool retain_internal_weights = false);
//Inherited methods override
void run() override;
diff --git a/arm_compute/runtime/MemoryGroupBase.h b/arm_compute/runtime/MemoryGroupBase.h
index dc640f10a6..06e4321410 100644
--- a/arm_compute/runtime/MemoryGroupBase.h
+++ b/arm_compute/runtime/MemoryGroupBase.h
@@ -96,7 +96,7 @@ inline MemoryGroupBase<TensorType>::MemoryGroupBase(std::shared_ptr<IMemoryManag
template <typename TensorType>
inline void MemoryGroupBase<TensorType>::manage(TensorType *obj)
{
- if(_memory_manager)
+ if(_memory_manager && _mappings.empty())
{
ARM_COMPUTE_ERROR_ON(!_memory_manager->lifetime_manager());
@@ -114,7 +114,11 @@ inline void MemoryGroupBase<TensorType>::manage(TensorType *obj)
template <typename TensorType>
inline void MemoryGroupBase<TensorType>::finalize_memory(TensorType *obj, void **handle, size_t size)
{
- if(_memory_manager)
+ // TODO (geopin01) : Check size (track size in MemoryMappings)
+ // Check if existing mapping is valid
+ ARM_COMPUTE_ERROR_ON(!_mappings.empty() && (_mappings.find(handle) == std::end(_mappings)));
+
+ if(_memory_manager && _mappings.empty())
{
ARM_COMPUTE_ERROR_ON(!_memory_manager->lifetime_manager());
_memory_manager->lifetime_manager()->end_lifetime(obj, handle, size);