aboutsummaryrefslogtreecommitdiff
path: root/arm_compute
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute')
-rw-r--r--arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h18
-rw-r--r--arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h25
-rw-r--r--arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h21
3 files changed, 46 insertions, 18 deletions
diff --git a/arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h b/arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h
index 3deaff74fc..6b92f12223 100644
--- a/arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h
+++ b/arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022-2023 Arm Limited.
+ * Copyright (c) 2022-2024 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ARM_COMPUTE_DYNAMIC_FUSION_RUNTIME_GPU_CL_CLWORKLOADRUNTIME
-#define ARM_COMPUTE_DYNAMIC_FUSION_RUNTIME_GPU_CL_CLWORKLOADRUNTIME
+#ifndef ACL_ARM_COMPUTE_DYNAMIC_FUSION_RUNTIME_GPU_CL_CLWORKLOADRUNTIME_H
+#define ACL_ARM_COMPUTE_DYNAMIC_FUSION_RUNTIME_GPU_CL_CLWORKLOADRUNTIME_H
#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/dynamic_fusion/sketch/MemoryDescriptor.h"
@@ -46,8 +46,18 @@ class GpuWorkloadSketch;
class ClWorkloadRuntime
{
public:
+ /** Default constructor. */
ClWorkloadRuntime();
+
+ /** Destructor */
~ClWorkloadRuntime();
+
+ /** Move constructor */
+ ClWorkloadRuntime(ClWorkloadRuntime &&);
+
+ /** Move assignment */
+ ClWorkloadRuntime &operator=(ClWorkloadRuntime &&);
+
/** Configure @ref ClWorkloadRuntime
* @note A runtime cannot be re-configured
*
@@ -78,4 +88,4 @@ private:
} // namespace dynamic_fusion
} // namespace experimental
} // namespace arm_compute
-#endif /* ARM_COMPUTE_DYNAMIC_FUSION_RUNTIME_GPU_CL_CLWORKLOADRUNTIME */
+#endif // ACL_ARM_COMPUTE_DYNAMIC_FUSION_RUNTIME_GPU_CL_CLWORKLOADRUNTIME_H
diff --git a/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h b/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h
index 38b350c7eb..76e425513e 100644
--- a/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h
+++ b/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022-2023 Arm Limited.
+ * Copyright (c) 2022-2024 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADCONTEXT
-#define ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADCONTEXT
+#ifndef ACL_ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADCONTEXT_H
+#define ACL_ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADCONTEXT_H
#include "arm_compute/core/GPUTarget.h"
#include "arm_compute/core/TensorInfo.h"
@@ -85,11 +85,14 @@ public:
* @return TensorInfo Newly created tensor info
*/
template <typename... TArgs>
- TensorInfo create_tensor_info(TArgs &&...args)
+ ITensorInfo *create_tensor_info(TArgs &&...args)
{
- auto tensor_info = TensorInfo(std::forward<TArgs>(args)...);
- register_user_tensor(tensor_info);
- return tensor_info;
+ auto tensor_info = std::make_unique<TensorInfo>(std::forward<TArgs>(args)...);
+ auto *tensor_info_ptr = tensor_info.get();
+
+ register_user_tensor(std::move(tensor_info));
+
+ return tensor_info_ptr;
}
/** Get the internal implementation */
@@ -101,9 +104,11 @@ public:
private:
/** Set a new ID to the tensor info and register its memory descriptor to the context.
*
- * @param[in,out] tensor_info @ref ITensorInfo to be registered.
+ * The ownership of the tensor info object will be transfered to this context object.
+ *
+ * @param[in] tensor_info @ref TensorInfo to be registered.
*/
- void register_user_tensor(ITensorInfo &tensor_info);
+ void register_user_tensor(std::unique_ptr<TensorInfo> &&tensor_info);
/** Internal implementation */
std::unique_ptr<Impl> _impl;
@@ -113,4 +118,4 @@ private:
} // namespace experimental
} // namespace arm_compute
-#endif /* ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADCONTEXT */
+#endif // ACL_ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADCONTEXT_H
diff --git a/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h b/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h
index 75c2b1f528..1c738bd060 100644
--- a/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h
+++ b/arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022-2023 Arm Limited.
+ * Copyright (c) 2022-2024 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADSKETCH
-#define ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADSKETCH
+#ifndef ACL_ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADSKETCH_H
+#define ACL_ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADSKETCH_H
#include "arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h"
@@ -53,15 +53,28 @@ public:
* @param[in] context Gpu context for the creation of a workload
*/
explicit GpuWorkloadSketch(GpuWorkloadContext *context);
+
/** Destructor */
~GpuWorkloadSketch();
+
+ /** Move constructor */
+ GpuWorkloadSketch(GpuWorkloadSketch &&);
+
+ /** Move assignment */
+ GpuWorkloadSketch &operator=(GpuWorkloadSketch &&);
+
/** Get the implementation */
Implementation &implementation();
+
/** Get the implementation */
const Implementation &implementation() const;
+
/** Get the gpu workload context of this sketch */
const GpuWorkloadContext *gpu_context() const;
+ /** Get the gpu workload context of this sketch */
+ GpuWorkloadContext *gpu_context();
+
private:
std::unique_ptr<Implementation> _impl; /**< Internal opaque implementation*/
};
@@ -69,4 +82,4 @@ private:
} // namespace dynamic_fusion
} // namespace experimental
} // namespace arm_compute
-#endif /* ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADSKETCH */
+#endif // ACL_ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_GPUWORKLOADSKETCH_H