Set minimum matrix size for AmdBlas::gemm to 20 since it works incorrect for small sizes
This commit is contained in:
@@ -781,8 +781,9 @@ void cv::gemm( InputArray matA, InputArray matB, double alpha,
|
|||||||
InputArray matC, double beta, OutputArray _matD, int flags )
|
InputArray matC, double beta, OutputArray _matD, int flags )
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CLAMDBLAS
|
#ifdef HAVE_CLAMDBLAS
|
||||||
CV_OCL_RUN(ocl::haveAmdBlas() && matA.dims() <= 2 && matB.dims() <= 2 && matC.dims() <= 2 && _matD.isUMat(),
|
CV_OCL_RUN(ocl::haveAmdBlas() && matA.dims() <= 2 && matB.dims() <= 2 && matC.dims() <= 2 && _matD.isUMat() &&
|
||||||
ocl_gemm(matA, matB, alpha, matC, beta, _matD, flags))
|
matA.cols() > 20 && matA.rows() > 20 && matB.cols() > 20, // since it works incorrect for small sizes
|
||||||
|
ocl_gemm(matA, matB, alpha, matC, beta, _matD, flags))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int block_lin_size = 128;
|
const int block_lin_size = 128;
|
||||||
|
@@ -90,14 +90,15 @@ PARAM_TEST_CASE(Gemm,
|
|||||||
|
|
||||||
void generateTestData()
|
void generateTestData()
|
||||||
{
|
{
|
||||||
Size ARoiSize = randomSize(1, MAX_VALUE);
|
// set minimum size to 20, since testing less sizes doesn't make sense
|
||||||
|
Size ARoiSize = randomSize(20, MAX_VALUE);
|
||||||
Border ABorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
|
Border ABorder = randomBorder(0, use_roi ? MAX_VALUE : 0);
|
||||||
randomSubMat(A, A_roi, ARoiSize, ABorder, type, -11, 11);
|
randomSubMat(A, A_roi, ARoiSize, ABorder, type, -11, 11);
|
||||||
|
|
||||||
if (atrans)
|
if (atrans)
|
||||||
ARoiSize = Size(ARoiSize.height, ARoiSize.width);
|
ARoiSize = Size(ARoiSize.height, ARoiSize.width);
|
||||||
|
|
||||||
Size BRoiSize = randomSize(1, MAX_VALUE);
|
Size BRoiSize = randomSize(20, MAX_VALUE);
|
||||||
if (btrans)
|
if (btrans)
|
||||||
BRoiSize.width = ARoiSize.width;
|
BRoiSize.width = ARoiSize.width;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user