aboutsummaryrefslogtreecommitdiff
path: root/src/gpu/cl/operators/ClFullyConnected.h
diff options
context:
space:
mode:
authorJakub Sujak <jakub.sujak@arm.com>2023-03-29 11:16:18 +0100
committerJakub Sujak <jakub.sujak@arm.com>2023-04-04 14:09:21 +0000
commit617ed50000532877296fff93973590a8ab67f96d (patch)
treed571654a2c31dfb6d5ec1529160b9f3d3348938c /src/gpu/cl/operators/ClFullyConnected.h
parentf26ea2f8cc957a1e6faf0361dea805fb2e236061 (diff)
downloadComputeLibrary-617ed50000532877296fff93973590a8ab67f96d.tar.gz
Support dynamic weights for Fully Connected layers on GPU
The fully connected function and operator running on GPU have been adapted to support dynamic weights. Dynamic weights require the reshape and data layout conversion of weight tensors at runtime in the prepare stage of the operator. The implementation for GPU is identical to the CPU implementation. This patch also deprecates the `are_weights_reshaped` option in Fully Connected. Resolves: COMPMID-5870 Change-Id: I28f967695879d82cc91a928d95308a4e0e52a597 Signed-off-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9403 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/gpu/cl/operators/ClFullyConnected.h')
-rw-r--r--src/gpu/cl/operators/ClFullyConnected.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gpu/cl/operators/ClFullyConnected.h b/src/gpu/cl/operators/ClFullyConnected.h
index b5ac70c93b..d08d5db8a4 100644
--- a/src/gpu/cl/operators/ClFullyConnected.h
+++ b/src/gpu/cl/operators/ClFullyConnected.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2021 Arm Limited.
+ * Copyright (c) 2017-2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -132,6 +132,12 @@ private:
bool _is_fc_after_conv{ true };
bool _is_quantized{ false };
bool _is_prepared{ false };
+ bool _dynamic_weights{ false };
+
+#ifdef ARM_COMPUTE_ASSERTS_ENABLED
+ int _asrt_run_count{};
+ int _asrt_prepare_count{};
+#endif // ARM_COMPUTE_ASSERTS_ENABLED
};
} // namespace opencl
} // namespace arm_compute