update new version

This commit is contained in:
luoliang
2022-10-09 14:18:04 +08:00
parent 6d24d6f096
commit be79c3e5c3
7 changed files with 60 additions and 63 deletions

View File

@@ -246,8 +246,9 @@ namespace cv
AclSafeCall(aclDestroyDataBuffer(inputBuffers_host[0]));
AclSafeCall(aclDestroyDataBuffer(inputBuffers_host[1]));
AclSafeCall(aclDestroyDataBuffer(outputBuffers_[0]));
aclrtFreeHost(perm);
aclrtFreeHost(host_data);
AclSafeCall(aclrtFree(dev));
AclSafeCall(aclrtFreeHost(perm));
AclSafeCall(aclrtFreeHost(host_data));
}
@@ -460,6 +461,7 @@ namespace cv
AclSafeCall(aclDestroyDataBuffer(inputBuffers_[0]));
AclSafeCall(aclDestroyDataBuffer(inputBuffers_[1]));
AclSafeCall(aclDestroyDataBuffer(outputBuffers_[0]));
AclSafeCall(aclrtFree(dev));
}
void flip(const aclMat& src, aclMat& dest, int filpCode, int stream_id)

View File

@@ -7,9 +7,8 @@ namespace opencv_test
{
namespace
{
aclCxt *acl_context_0 = set_device("../../modules/acl/test/acl.json", 0, 3);
aclCxt *acl_context_0 = set_device("../../modules/acl/test/acl.json", 2, 3);
////////////////////////////////////////////////////Correctness_test////////////////////////////////////////////////////////
#if 0
/* range: rows: 1 ~ 64, cols: 1 ~ 64, type: 0 ~ 7
* test function:
* config: MEMORY_ALIGN
@@ -178,7 +177,7 @@ namespace opencv_test
AclMat_Test test;
test.Test_operator_div(acl_context_0);
}
#endif
////////////////////////////////////////////////////Perf_test////////////////////////////////////////////////////////
TEST(Operator, add)
@@ -282,13 +281,7 @@ namespace opencv_test
PERF_TEST test;
test.Test_Split(acl_context_0);
}
/*
TEST(Matrices, lookuptable)
{
PERF_TEST test;
test.Test_Lookuptable(acl_context_0);
}
*/
TEST(Matrices, transpose)
{
@@ -302,7 +295,5 @@ namespace opencv_test
test.Test_Flip(acl_context_0);
release_device(acl_context_0);
}
}
}

View File

@@ -6,7 +6,7 @@ void PERF_TEST::Test_operator_add_perf(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
@@ -59,11 +59,12 @@ void PERF_TEST::Test_operator_sub_perf(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_8UC1, CV_32FC1, CV_32SC1};
vector<int> type{CV_8UC1, CV_32FC1, CV_32SC1,CV_64FC1};
//vector<int> type{CV_64FC1};
for (size_t i = 0; i < type.size(); ++i)
{
test.PrintLog("Perf test : Function: operator-=()", type[i]);
@@ -113,11 +114,12 @@ void PERF_TEST::Test_operator_div_perf(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_8UC1,CV_32FC1, CV_32SC1, CV_64FC1};
for (size_t i = 0; i < type.size(); ++i)
{
test.PrintLog("Perf test : Function: operator/=()", type[i]);
@@ -164,7 +166,7 @@ void PERF_TEST::Test_operator_mul_perf(aclCxt *acl_context)
{
int val, n;
int valmax = 4096;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};

View File

@@ -5,7 +5,7 @@ void PERF_TEST::Test_MatMul(aclCxt *acl_context)
{
int val, n;
int valmax = 4096;
int cycle_index = 100;
int cycle_index = 10;//100;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
@@ -61,7 +61,7 @@ void PERF_TEST::Test_Convolution(aclCxt *acl_context)
{
int val, n;
int valmax = 4096;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};

View File

@@ -5,11 +5,12 @@ void PERF_TEST::Test_Abs(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_32FC1,CV_32SC1};
for (size_t i = 0; i < type.size(); ++i)
{
test.PrintLog("Perf test : Function: Abs()", type[i]);
@@ -55,11 +56,12 @@ void PERF_TEST::Test_Pow(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_8UC1, CV_32FC1,CV_32SC1};
for (size_t i = 0; i < type.size(); ++i)
{
test.PrintLog("Perf test : Function: Pow()", type[i]);
@@ -106,11 +108,11 @@ void PERF_TEST::Test_Sqrt(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_32FC1,CV_64FC1};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
@@ -157,11 +159,11 @@ void PERF_TEST::Test_Add(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_8UC1,CV_32FC1, CV_32SC1, CV_64FC1};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
@@ -213,11 +215,11 @@ void PERF_TEST::Test_Divide(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_8UC1,CV_32FC1, CV_32SC1};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
@@ -268,11 +270,12 @@ void PERF_TEST::Test_Exp(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_32FC1,CV_64FC1};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
@@ -319,11 +322,11 @@ void PERF_TEST::Test_Log(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_32FC1,CV_64FC1};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
@@ -370,11 +373,11 @@ void PERF_TEST::Test_Max(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC2};
// vector<int> type{CV_32FC2};
vector<int> type{CV_32FC2,CV_32SC2, CV_64FC2};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
@@ -425,16 +428,16 @@ void PERF_TEST::Test_Min(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC3};
//vector<int> type{CV_32FC3};
vector<int> type{CV_32FC3,CV_32SC3, CV_64FC3};
for (size_t i = 0; i < type.size(); ++i)
{
for (val = 8; val <= valmax; val *= 2)
{
int n = cycle_index;
n = cycle_index;
Mat mat_src1(val, val, type[i]);
Mat mat_src2(val, val, type[i]);
Mat mat_dest(val, val, type[i]);

View File

@@ -30,13 +30,15 @@ void PERF_TEST::Test_Merge(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> srcType{CV_32FC1};
vector<int> destType{CV_32FC3};
vector<int> srcType{CV_8UC1,CV_32FC1, CV_32SC1};
//vector<int> destType{CV_32FC3};
vector<int> destType{CV_8UC3,CV_32FC3, CV_32SC3};
for (size_t i = 0; i < srcType.size(); ++i)
{
test.PrintLog("Perf test : Function: merge()", srcType[i]);
@@ -100,11 +102,12 @@ void PERF_TEST::Test_Transpose(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> type{CV_32FC1};
//vector<int> type{CV_32FC1};
vector<int> type{CV_32FC1,CV_32SC1};
for (size_t i = 0; i < type.size(); ++i)
{
test.PrintLog("Perf test : Function: transpose()", type[i]);
@@ -152,13 +155,13 @@ void PERF_TEST::Test_Split(aclCxt *acl_context)
{
int val, n;
int valmax = 8192;
int cycle_index = 100;
int cycle_index = 10;
double begin, end, time, acltime;
Common_Test test;
vector<int> srcType{CV_32FC3};
vector<int> destType{CV_32FC1};
//vector<int> srcType{CV_32FC3};
vector<int> srcType{CV_8UC3,CV_32FC3, CV_32SC3};
vector<int> destType{CV_8UC1,CV_32FC1, CV_32SC1};
for (size_t i = 0; i < srcType.size(); ++i)
{
test.PrintLog("Perf test : Function: split()", srcType[i]);

View File

@@ -28,10 +28,6 @@ public:
CV_EXPORTS void Test_Split(aclCxt *acl_context);
CV_EXPORTS void Test_Transpose(aclCxt *acl_context);
CV_EXPORTS void Test_Flip(aclCxt *acl_context);
CV_EXPORTS void Test_other(aclCxt *acl_context);
CV_EXPORTS void Test_other1(aclCxt *acl_context);
CV_EXPORTS void Test_other2();
};
#endif