24 template <
typename QueueDescriptorType>
25 std::unique_ptr<IWorkload> GpuFsaWorkloadFactory::MakeWorkload(
const QueueDescriptorType& ,
26 const WorkloadInfo& )
const
31 template <DataType ArmnnType>
34 auto checkType = [](
const TensorInfo& tensorInfo) {
return tensorInfo.GetDataType() == ArmnnType;};
35 auto it = std::find_if(std::begin(
info.m_InputTensorInfos), std::end(
info.m_InputTensorInfos), checkType);
36 if (it != std::end(
info.m_InputTensorInfos))
40 it = std::find_if(std::begin(
info.m_OutputTensorInfos), std::end(
info.m_OutputTensorInfos), checkType);
41 if (it != std::end(
info.m_OutputTensorInfos))
49 : m_MemoryManager(memoryManager)
67 std::string& outReasonIfUnsupported)
75 std::unique_ptr<GpuFsaTensorHandle> tensorHandle = std::make_unique<GpuFsaTensorHandle>(tensorInfo);
76 tensorHandle->SetMemoryGroup(m_MemoryManager->GetInterLayerMemoryGroup());
85 std::unique_ptr<GpuFsaTensorHandle> tensorHandle = std::make_unique<GpuFsaTensorHandle>(tensorInfo, dataLayout);
86 tensorHandle->SetMemoryGroup(m_MemoryManager->GetInterLayerMemoryGroup());
94 auto context = arm_compute::CLKernelLibrary::get().context();
95 auto device = arm_compute::CLKernelLibrary::get().get_device();
96 m_CLCompileContext = arm_compute::CLCompileContext(context, device);
107 auto constQueueDescriptor = PolymorphicDowncast<const ConstantQueueDescriptor*>(&descriptor);
108 return std::make_unique<GpuFsaConstantWorkload>(*constQueueDescriptor,
info, m_CLCompileContext);
112 auto inputQueueDescriptor = PolymorphicDowncast<const InputQueueDescriptor*>(&descriptor);
113 return std::make_unique<CopyMemGenericWorkload>(*inputQueueDescriptor,
info);
117 auto outputQueueDescriptor = PolymorphicDowncast<const OutputQueueDescriptor*>(&descriptor);
118 return std::make_unique<CopyMemGenericWorkload>(*outputQueueDescriptor,
info);
122 auto memCopyQueueDescriptor = PolymorphicDowncast<const MemCopyQueueDescriptor*>(&descriptor);
123 if (memCopyQueueDescriptor->m_Inputs.empty() || !memCopyQueueDescriptor->m_Inputs[0])
127 return std::make_unique<CopyMemGenericWorkload>(*memCopyQueueDescriptor,
info);
131 auto precompiledQueueDescriptor = PolymorphicDowncast<const PreCompiledQueueDescriptor*>(&descriptor);
132 return std::make_unique<GpuFsaPreCompiledWorkload>(*precompiledQueueDescriptor,
info);