11 #include <arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h>
12 #include <arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h>
13 #include <arm_compute/dynamic_fusion/sketch/gpu/operators/GpuPool2d.h>
14 #include <arm_compute/dynamic_fusion/sketch/gpu/operators/GpuOutput.h>
16 using namespace arm_compute::experimental::dynamic_fusion;
17 using namespace armnn::armcomputetensorutils;
26 auto compileCtx = arm_compute::CLKernelLibrary::get().get_compile_context();
27 auto workloadContext = GpuWorkloadContext(&compileCtx);
28 GpuWorkloadSketch sketch{ &workloadContext };
30 arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.
m_DataLayout);
31 aclInputInfo.set_are_values_constant(input.
IsConstant());
32 arm_compute::ITensorInfo* inputInfo = workloadContext.create_tensor_info(aclInputInfo);
35 GpuPool2dSettings pool2dSettings{};
37 return GpuPool2d::validate_op(sketch, inputInfo, pool2dAttributes, pool2dSettings);
44 GpuWorkloadSketch* sketch = blob->
sketch.get();
46 std::vector<arm_compute::ITensorInfo*> inputTensorInfos = {};
47 std::vector<arm_compute::ITensorInfo*> outputTensorInfos = {};
49 arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.
m_DataLayout);
50 aclInputInfo.set_are_values_constant(input.
IsConstant());
52 inputTensorInfos.emplace_back(workloadContext->create_tensor_info(aclInputInfo));
55 GpuPool2dSettings pool2dSettings{};
63 const bool supported = aclStatus.error_code() == arm_compute::ErrorCode::OK;
69 arm_compute::ITensorInfo* addOutputInfo = GpuPool2d::create_op(*sketch,
75 outputTensorInfos.emplace_back(workloadContext->create_tensor_info());
76 GpuOutput::create_op(*sketch, addOutputInfo, outputTensorInfos[0]);
79 blob->
inputTensorInfos = std::make_unique<std::vector<arm_compute::ITensorInfo*>>(inputTensorInfos);
80 blob->
outputTensorInfos = std::make_unique<std::vector<arm_compute::ITensorInfo*>>(outputTensorInfos);