14 #include <arm_compute/runtime/NEON/functions/NEConv3D.h>
22 using namespace armcomputetensorutils;
29 bool isFastMathEnabled,
32 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.
m_DataLayout);
33 const arm_compute::TensorInfo aclWeightsInfo = BuildArmComputeTensorInfo(weights, descriptor.
m_DataLayout);
34 arm_compute::TensorInfo aclBiasesInfo;
35 arm_compute::TensorInfo *optionalAclBiasesInfo =
nullptr;
41 "ArmNN NeonConvolution3dWorkload has empty bias value."};
44 aclBiasesInfo = BuildArmComputeTensorInfo(biases.
value(), descriptor.
m_DataLayout);
45 optionalAclBiasesInfo = &aclBiasesInfo;
47 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output, descriptor.
m_DataLayout);
51 activationDescriptor);
53 return arm_compute::NEConv3D::validate(&aclInputInfo,
55 optionalAclBiasesInfo,
62 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager,
63 const bool isFastMathEnabled)
68 using arm_compute::NEConv3D;
72 arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[0])->GetTensor();
73 arm_compute::ITensor& weights = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[1])->GetTensor();
74 arm_compute::ITensor* biasesPtr =
nullptr;
77 biasesPtr = &PolymorphicDowncast<IAclTensorHandle *>(
m_Data.
m_Inputs[2])->GetTensor();
79 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Outputs[0])->GetTensor();
82 input.info()->set_data_layout(aclDataLayout);
83 weights.info()->set_data_layout(aclDataLayout);
84 output.info()->set_data_layout(aclDataLayout);
86 const arm_compute::Conv3dInfo aclConv3DInfo =
ComputeConv3DInfo(descriptor, isFastMathEnabled);
88 auto convolutionLayer = std::make_unique<arm_compute::NEConv3D>();
89 convolutionLayer->configure(&input,
107 m_ConvolutionLayer.reset(convolutionLayer.release());
111 m_ConvolutionLayer->prepare();
117 m_ConvolutionLayer->run();