diff options
Diffstat (limited to 'src/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.cpp')
-rw-r--r-- | src/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.cpp b/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.cpp index ce7cf1e908..33f672071d 100644 --- a/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.cpp +++ b/src/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -43,23 +43,18 @@ const GpuWorkloadSketch::Context *GpuWorkloadSketch::gpu_context() const return _impl->context(); } -TensorInfo GpuWorkloadSketch::create_tensor_info(const ITensorInfo &tensor_info) +void GpuWorkloadSketch::register_new_tensor(ITensorInfo &tensor_info) { - TensorInfo tensor{ tensor_info }; - tensor.set_id(allocate_new_tensor_id()); - return tensor; + tensor_info.set_id(_impl->allocate_new_tensor_id()); + // All input output tensors are User tensors that need real backing memory + _impl->register_memory_descriptor(tensor_info, MemoryDescriptor{ MemoryType::User }); } TensorInfo GpuWorkloadSketch::create_tensor_info() { - TensorInfo tensor{}; - tensor.set_id(allocate_new_tensor_id()); - return tensor; -} - -ITensorInfo::Id GpuWorkloadSketch::allocate_new_tensor_id() -{ - return _impl->allocate_new_tensor_id(); + TensorInfo tensor_info{}; + register_new_tensor(tensor_info); + return tensor_info; } GpuWorkloadSketch::Implementation &GpuWorkloadSketch::implementation() |