MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / gercCorrectnessTest

Function gercCorrectnessTest

src/tests/correctness/corr-gerc.cpp:66–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65template <typename T>
66void
67gercCorrectnessTest(TestParams *params)
68{
69 cl_int err;
70 T *A, *x, *y, *backA;
71 //size_t N, M;
72
73 T alpha_;
74 cl_mem bufA, bufx, bufy;
75 clMath::BlasBase *base;
76 cl_event *events;
77// int ka, kxy;
78
79 base = clMath::BlasBase::getInstance();
80
81 if ((typeid(T) == typeid(cl_double) ||
82 typeid(T) == typeid(DoubleComplex)) &&
83 !base->isDevSupportDoublePrecision()) {
84
85 std::cerr << ">> WARNING: The target device doesn't support native "
86 "double precision floating point arithmetic" <<
87 std::endl << ">> Test skipped" << std::endl;
88 SUCCEED();
89 return;
90 }
91
92 events = new cl_event[params->numCommandQueues];
93 memset(events, 0, params->numCommandQueues * sizeof(cl_event));
94
95 size_t lengthA;
96 if( params->order == clblasColumnMajor )
97 lengthA = params->N * params->lda;
98 else
99 lengthA = params->M * params->lda;
100
101 size_t lengthx = (1 + (((params->M)-1) * abs(params->incx)));
102 size_t lengthy = (1 + (((params->N)-1) * abs(params->incy)));
103
104 bool useAlpha = base->useAlpha();
105
106 if (useAlpha) {
107 alpha_ = convertMultiplier<T>(params->alpha);
108 }
109
110
111 A = new T[lengthA + params->offa];
112 x = new T[lengthx + params->offBX];
113 y = new T[lengthy + params->offCY];
114 backA = new T[lengthA + params->offa];
115
116 if((A == NULL) || (backA == NULL) || (x == NULL) || (y == NULL))
117 {
118 ::std::cerr << "Cannot allocate memory on host side\n" << "!!!!!!!!!!!!Test skipped.!!!!!!!!!!!!" << ::std::endl;
119 deleteBuffers<T>(A, x, y, backA);
120 delete[] events;
121 SUCCEED();
122 return;
123 }

Callers

nothing calls this directly

Calls 10

populateFunction · 0.85
doConjugateFunction · 0.85
printTestParamsFunction · 0.85
useAlphaMethod · 0.80
createEnqueueBufferMethod · 0.80
commandQueuesMethod · 0.80
alphaMethod · 0.80
releaseMemObjectsFunction · 0.70
waitForSuccessfulFinishFunction · 0.50

Tested by

no test coverage detected