24.02.1
|
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... | |
Typedefs | |
using | GeMMConfigsMatrix = std::vector< std::vector< int32_t > > |
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... | |
bool | is_mmul_kernel_preferred (const unsigned int m, const unsigned int n, const unsigned int k, const unsigned int b, const DataType data_type, unsigned int &best_m0, unsigned int &best_n0) |
Determine if the MMUL kernels should be preferred. More... | |
std::pair< GEMMLHSMatrixInfo, GEMMRHSMatrixInfo > | find_lhs_rhs_info (const GeMMConfigsMatrix &configs, unsigned int m, unsigned int n, unsigned int k, unsigned int b) |
Find the preferred configurations for the LHS and RHS tensor using the GeMMConfigsMatrix provided by the user. More... | |
using GeMMConfigsMatrix = std::vector<std::vector<int32_t> > |
Definition at line 38 of file ClGemmHelpers.h.
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 42 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_ERROR_ON, arm_compute::export_to_cl_image(), and arm_compute::utils::cast::U.
Referenced by find_lhs_rhs_info(), 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 > find_lhs_rhs_info | ( | const GeMMConfigsMatrix & | configs, |
unsigned int | m, | ||
unsigned int | n, | ||
unsigned int | k, | ||
unsigned int | b | ||
) |
Find the preferred configurations for the LHS and RHS tensor using the GeMMConfigsMatrix provided by the user.
[in] | configs | List of best configurations for a limited number of GeMM shapes |
[in] | m | Number of rows of the LHS matrix |
[in] | n | Number of columns of the RHS matrix |
[in] | k | Number of columns of the LHS matrix, rows of the RHS matrix |
[in] | b | Batch size |
Definition at line 174 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_UNUSED, arm_compute::test::validation::b, configure_lhs_rhs_info(), and arm_compute::utils::cast::U.
bool is_mmul_kernel_preferred | ( | const unsigned int | m, |
const unsigned int | n, | ||
const unsigned int | k, | ||
const unsigned int | b, | ||
const DataType | data_type, | ||
unsigned int & | best_m0, | ||
unsigned int & | best_n0 | ||
) |
Determine if the MMUL kernels should be preferred.
[in] | m | Number of rows of the LHS matrix |
[in] | n | Number of columns of the RHS matrix |
[in] | k | Number of columns of the LHS matrix, rows of the RHS matrix |
[in] | b | Batch size |
[in] | data_type | Data type FP32/FP16 |
[in,out] | best_m0 | Suggested M0 (number of rows of the output block) for the kernel |
[in,out] | best_n0 | Suggested N0 (number of columns of the output block) for the kernel |
Definition at line 151 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_UNUSED, arm_compute::test::validation::b, arm_compute::ceil_to_multiple(), and arm_compute::test::validation::data_type.
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 76 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, arm_compute::test::validation::b, arm_compute::misc::shape_calculator::compute_rhs_reshaped_shape(), arm_compute::test::validation::data_type, arm_compute::test::validation::shape, and validate_image2d_support_on_rhs().
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 100 of file ClGemmHelpers.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, CLKernelLibrary::get(), arm_compute::get_cl_image_pitch_alignment(), and tensor.
Referenced by ClMatMulNativeKernel::configure(), ClIndirectConv2dKernel::configure(), ClDirectConv2dKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), GpuDepthwiseConv2d::create_op(), and GpuConv2d::create_op().
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 121 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, ITensorInfo::tensor_shape(), and GEMMRHSMatrixInfo::transpose.
Referenced by select_lhs_rhs_info().