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

Function symvCorrectnessTest

src/tests/correctness/corr-symv.cpp:51–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50template <typename T>
51void
52symvCorrectnessTest(TestParams *params)
53{
54 cl_int err;
55 T *A, *B, *blasC, *clblasC, *X, *Y;
56 T alpha, beta;
57 cl_mem bufA, bufB, bufC;
58 clMath::BlasBase *base;
59 bool useAlpha, useBeta;
60 cl_event *events;
61 bool isComplex;
62
63 base = clMath::BlasBase::getInstance();
64
65 if ((typeid(T) == typeid(cl_double) ||
66 typeid(T) == typeid(DoubleComplex)) &&
67 !base->isDevSupportDoublePrecision()) {
68
69 std::cerr << ">> WARNING: The target device doesn't support native "
70 "double precision floating point arithmetic" <<
71 std::endl << ">> Test skipped" << std::endl;
72 SUCCEED();
73 return;
74 }
75
76 isComplex = ((typeid(T) == typeid(FloatComplex)) ||
77 (typeid(T) == typeid(DoubleComplex)));
78 if (canCaseBeSkipped(params, isComplex)) {
79 std::cerr << ">> Test is skipped" << std::endl;
80 SUCCEED();
81 return;
82 }
83
84 useAlpha = base->useAlpha();
85 useBeta = base->useBeta();
86 alpha = ZERO<T>();
87 beta = ZERO<T>();
88
89 events = new cl_event[params->numCommandQueues];
90 memset(events, 0, params->numCommandQueues * sizeof(cl_event));
91
92 A = new T[params->rowsA * params->columnsA];
93 // X and Y are rows or columns in matrixes B and C
94 B = new T[params->rowsB * params->columnsB];
95 blasC = new T[params->rowsC * params->columnsC];
96 clblasC = new T[params->rowsC * params->columnsC];
97 X = &B[params->offBX];
98 Y = &blasC[params->offCY];
99
100 srand(params->seed);
101 if (useAlpha) {
102 alpha = convertMultiplier<T>(params->alpha);
103 }
104 if (useBeta) {
105 beta = convertMultiplier<T>(params->beta);
106 }
107
108 setNans<T>(params->rowsA * params->columnsA, A);

Callers

nothing calls this directly

Calls 14

canCaseBeSkippedFunction · 0.85
randomGemmMatricesFunction · 0.85
compareVectorsFunction · 0.85
printTestParamsFunction · 0.85
useAlphaMethod · 0.80
useBetaMethod · 0.80
createEnqueueBufferMethod · 0.80
commandQueuesMethod · 0.80
alphaMethod · 0.80
betaMethod · 0.80
releaseMemObjectsFunction · 0.70

Tested by

no test coverage detected