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

Function gerCorrectnessTest

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

Source from the content-addressed store, hash-verified

64
65template <typename T>
66void
67gerCorrectnessTest(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 lengthA = params->M * params->lda;
99
100 size_t lengthx = (1 + (((params->M)-1) * abs(params->incx)));
101 size_t lengthy = (1 + (((params->N)-1) * abs(params->incy)));
102
103 bool useAlpha = base->useAlpha();
104
105 if (useAlpha) {
106 alpha_ = convertMultiplier<T>(params->alpha);
107 }
108
109
110 A = new T[lengthA + params->offa];
111 x = new T[lengthx + params->offBX];
112 y = new T[lengthy + params->offCY];
113 backA = new T[lengthA + params->offa];
114
115 if((A == NULL) || (backA == NULL) || (x == NULL) || (y == NULL))
116 {
117 ::std::cerr << "Cannot allocate memory on host side\n" << "!!!!!!!!!!!!Test skipped.!!!!!!!!!!!!" << ::std::endl;
118 deleteBuffers<T>(A, backA, x, y);
119 delete[] events;
120 SUCCEED();
121 return;
122 }
123

Callers

nothing calls this directly

Calls 9

populateFunction · 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