Compute Library
 22.11
ClDirectConv3d Class Reference

Basic function to simulate a directly convolution layer with 3 spatial dimensions. More...

#include <ClDirectConv3d.h>

Collaboration diagram for ClDirectConv3d:
[legend]

Public Member Functions

 ClDirectConv3d ()=default
 
void configure (const CLCompileContext &compile_context, const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *src2, ITensorInfo *dst, const Conv3dInfo &conv3d_info)
 Set the src and dst tensors. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from ICLOperator
 ICLOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLOperator (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLOperator (ICLOperator &&)=default
 Default move constructor. More...
 
ICLOperatoroperator= (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLOperatoroperator= (ICLOperator &&)=default
 Default move assignment operator. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. More...
 
MemoryRequirements workspace () const override
 Return the memory requirements required by the workspace. More...
 
- Public Member Functions inherited from IOperator
virtual ~IOperator ()=default
 Destructor. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const Conv3dInfo &conv3d_info)
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

Basic function to simulate a directly convolution layer with 3 spatial dimensions.

This function calls the following OpenCL kernels:

  1. opencl::ClDirectConv3d

Definition at line 44 of file ClDirectConv3d.h.

Constructor & Destructor Documentation

◆ ClDirectConv3d()

ClDirectConv3d ( )
default

Member Function Documentation

◆ configure()

void configure ( const CLCompileContext compile_context,
const ITensorInfo src0,
const ITensorInfo src1,
const ITensorInfo src2,
ITensorInfo dst,
const Conv3dInfo conv3d_info 
)

Set the src and dst tensors.

Valid data layouts:

  • NDHWC

Valid data type configurations:

src0 src1 src2 dst
F16 F16 F16 F16
F32 F32 F32 F32
QASYMM8 QASYMM8 S32 QASYMM8
QASYMM8_SIGNED QASYMM8_SIGNED S32 QASYMM8_SIGNED
Parameters
[in]compile_contextThe compile context to be used.
[in]src0Source tensor. 4 lower dimensions represent a single src [IFM, width, height, depth], while every optional dimension from 5 and above represent a batch of srcs.
[in]src1Weights tensor. Weights are 5D tensor with dimensions [OFM, IFM, kernel_w, kernel_h, kernel_d].
[in]src2Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM].
[out]dstDestination tensor. 4 lower dimensions represent a single dst [OFM, width, height, depth], while the rest represent batch of dsts.
[in]conv3d_infoContains strides, padding, rounding, activation, dilation and fast math information. Activation and fast math are currently unused.

Definition at line 33 of file ClDirectConv3d.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR, and arm_compute::test::validation::k.

34 {
36 
37  // Configure direct convolution 3d kernel
38  auto k = std::make_unique<kernels::ClDirectConv3dKernel>();
39  k->configure(compile_context, src0, src1, src2, dst, conv3d_info);
40  _direct_conv3d_kernel = std::move(k);
41 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157

◆ run()

void run ( ITensorPack tensors)
overridevirtual

Run the kernels contained in the function.

Parameters
[in]tensorsVector that contains the tensors to operate on.

Reimplemented from ICLOperator.

Definition at line 49 of file ClDirectConv3d.cpp.

References CLScheduler::enqueue_op(), and CLScheduler::get().

50 {
51  // Run direct convolution 3d
52  CLScheduler::get().enqueue_op(*_direct_conv3d_kernel.get(), tensors, true);
53 }
static CLScheduler & get()
Access the scheduler singleton.
void enqueue_op(ICLKernel &kernel, ITensorPack &tensors, bool flush=true)
Schedule the execution of the passed kernel if possible.

◆ validate()

Status validate ( const ITensorInfo src0,
const ITensorInfo src1,
const ITensorInfo src2,
const ITensorInfo dst,
const Conv3dInfo conv3d_info 
)
static

Static function to check if given info will lead to a valid configuration.

Similar to ClDirectConv3d::configure()

Returns
a status

Definition at line 43 of file ClDirectConv3d.cpp.

References ARM_COMPUTE_RETURN_ON_ERROR, and ClDirectConv3dKernel::validate().

Referenced by CLConv3D::validate().

44 {
46  return Status{};
47 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
static Status validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const Conv3dInfo &conv3d_info)
Static function to check if given info will lead to a valid configuration.

The documentation for this class was generated from the following files: