22.05
|
Data Structures | |
class | CLGEMMConfigArray |
Basic container for the OpenCL GEMM configuration functions. More... | |
class | ClGemmDefaultConfigNativeBifrost |
Bifrost based OpenCL GEMMNative configuration. More... | |
class | ClGemmDefaultConfigNativeMidgard |
Midgard based OpenCL GEMMNative configuration. More... | |
class | ClGemmDefaultConfigNativeValhall |
Valhall based OpenCL GEMMNative configuration. More... | |
class | ClGemmDefaultConfigReshapedBifrost |
Bifrost based OpenCL GEMMReshaped configuration. More... | |
class | ClGemmDefaultConfigReshapedRhsOnlyBifrost |
Bifrost based OpenCL GEMMReshapedOnlyRHS configuration. More... | |
class | ClGemmDefaultConfigReshapedRhsOnlyValhall |
Valhall based OpenCL GEMMReshapedOnlyRHS configuration. More... | |
class | ClGemmDefaultConfigReshapedValhall |
Valhall based OpenCL GEMMReshaped configuration. More... | |
class | ClGemmNativeKernelConfigurationFactory |
CLGEMMNative factory class. More... | |
class | ClGemmReshapedKernelConfigurationFactory |
CLGEMMReshaped factory class. More... | |
class | ClGemmReshapedOnlyRhsKernelConfigurationFactory |
CLGEMMReshapedOnlyRHS factory class. More... | |
class | IClGemmKernelConfig |
Basic interface for the GEMM kernel configuration. More... | |
Functions | |
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > | configure_lhs_rhs_info (unsigned int m, unsigned int n, unsigned int m0, unsigned int n0, unsigned int k0, unsigned int v0, unsigned int h0, bool lhs_interleave, bool rhs_interleave, bool lhs_transpose, bool rhs_transpose, bool export_to_cl_image=false) |
Configure GEMMLHSMatrixInfo and GEMMRHSMatrixInfo. More... | |
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > | select_lhs_rhs_info (std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > info_img, std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > info_buf, unsigned int n, unsigned int k, unsigned int b, DataType data_type) |
Select GEMMLHSMatrixInfo and GEMMRHSMatrixInfo. More... | |
void | update_padding_for_cl_image (ITensorInfo *tensor) |
Update padding required to export the OpenCL buffer to OpenCL image2d. More... | |
Status | validate_image2d_support_on_rhs (const ITensorInfo &tensor_reshaped_info, const GEMMRHSMatrixInfo &rhs_info) |
Utility function to validate the image2d OpenCL object support on the RHS reshaped matrix. More... | |
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > configure_lhs_rhs_info | ( | unsigned int | m, |
unsigned int | n, | ||
unsigned int | m0, | ||
unsigned int | n0, | ||
unsigned int | k0, | ||
unsigned int | v0, | ||
unsigned int | h0, | ||
bool | lhs_interleave, | ||
bool | rhs_interleave, | ||
bool | lhs_transpose, | ||
bool | rhs_transpose, | ||
bool | export_to_cl_image = false |
||
) |
Configure GEMMLHSMatrixInfo and GEMMRHSMatrixInfo.
[in] | m | Number of rows (M) in the LHS matrix not reshaped |
[in] | n | Number of columns (N) in the RHS matrix not reshaped |
[in] | m0 | Number of rows processed by each thread/work-item |
[in] | n0 | Number of columns processed by each thread/work-item |
[in] | k0 | Number of inner accumulation performed by each thread/work-item |
[in] | v0 | Number of vertical blocks of size (m0xk0) stored on the same output row |
[in] | h0 | Number of horizontal blocks of size (k0xn0) stored on the same output row |
[in] | lhs_interleave | True if the v0 (m0xk0) blocks have to be interleaved in the output row |
[in] | rhs_interleave | True if the h0 (k0xn0) blocks have to be interleaved in the output row |
[in] | lhs_transpose | True if the (m0xk0) block has to be transposed before been stored |
[in] | rhs_transpose | True if the (k0xn0) block has to be transposed before been stored |
[in] | export_to_cl_image | (Optional) True if the RHS reshaped matrix has to be exported to cl_image |
Definition at line 41 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::lhs_info, and arm_compute::test::validation::rhs_info.
Referenced by ClGemmDefaultConfigNativeBifrost::configure(), ClGemmDefaultConfigNativeMidgard::configure(), ClGemmDefaultConfigReshapedBifrost::configure(), ClGemmDefaultConfigReshapedValhall::configure(), ClGemmDefaultConfigReshapedRhsOnlyValhall::configure(), ClGemmDefaultConfigReshapedRhsOnlyBifrost::configure(), ClGemmDefaultConfigNativeValhall::configure(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_native(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_reshaped(), and arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_reshaped_only_rhs().
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > select_lhs_rhs_info | ( | std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > | info_img, |
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > | info_buf, | ||
unsigned int | n, | ||
unsigned int | k, | ||
unsigned int | b, | ||
DataType | data_type | ||
) |
Select GEMMLHSMatrixInfo and GEMMRHSMatrixInfo.
This function accepts two pairs of GEMMLHSMatrixInfo/GEMMRHSMatrixInfo where only the first is with cl_image2d support, and selects the valid one validating the GEMMRHSMatrixInfo. If the validation passes, the functions will return the first GEMMLHSMatrixInfo/GEMMRHSMatrixInfo pair with cl_image2d support.
[in] | info_img | GEMMLHSMatrixInfo/GEMMRHSMatrixInfo with cl_image2d support |
[in] | info_buf | GEMMLHSMatrixInfo/GEMMRHSMatrixInfo to fall-back if cl_image2d cannot be used |
[in] | n | Number of columns (N) in the RHS matrix not reshaped |
[in] | k | Number of rows (K) in the RHS matrix not reshaped |
[in] | b | Batch size |
[in] | data_type | Data type |
Definition at line 54 of file ClGemmHelpers.cpp.
References arm_compute::misc::shape_calculator::compute_rhs_reshaped_shape(), arm_compute::test::validation::shape, and validate_image2d_support_on_rhs().
Referenced by ClGemmDefaultConfigReshapedBifrost::configure(), ClGemmDefaultConfigReshapedRhsOnlyValhall::configure(), ClGemmDefaultConfigReshapedRhsOnlyBifrost::configure(), and ClGemmDefaultConfigReshapedValhall::configure().
void update_padding_for_cl_image | ( | ITensorInfo * | tensor | ) |
Update padding required to export the OpenCL buffer to OpenCL image2d.
[in,out] | tensor | ITensorInfo of the tensor required to be exported to OpenCL image2d |
Definition at line 72 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, ITensorInfo::element_size(), ITensorInfo::extend_padding(), CLKernelLibrary::get(), arm_compute::get_cl_image_pitch_alignment(), ITensorInfo::padding(), BorderSize::right, and ITensorInfo::strides_in_bytes().
Referenced by ClDirectConv2dKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), and ClDirectConvolutionKernelComponent::generate_build_options().
Status validate_image2d_support_on_rhs | ( | const ITensorInfo & | tensor_reshaped_info, |
const GEMMRHSMatrixInfo & | rhs_info | ||
) |
Utility function to validate the image2d OpenCL object support on the RHS reshaped matrix.
[in] | tensor_reshaped_info | TensorInfo for the RHS reshaped matrix |
[in] | rhs_info | GEMMRHSMatrixInfo |
Definition at line 92 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MSG, GEMMRHSMatrixInfo::export_to_cl_image, arm_compute::F16, arm_compute::F32, CLKernelLibrary::get(), arm_compute::get_cl_image_pitch_alignment(), CLKernelLibrary::get_device(), arm_compute::image2d_from_buffer_supported(), GEMMRHSMatrixInfo::k0, GEMMRHSMatrixInfo::n0, and ITensorInfo::tensor_shape().
Referenced by ClGemmDefaultConfigReshapedBifrost::configure(), ClGemmDefaultConfigReshapedRhsOnlyBifrost::configure(), and select_lhs_rhs_info().