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

Function trsmCorrectnessTest

src/tests/correctness/corr-trsm.cpp:52–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51template <typename T>
52void
53trsmCorrectnessTest(TestParams *params)
54{
55 cl_int err;
56 T *A, *B, *blasB, *clblasB;
57 T alpha;
58 cl_mem bufA, bufB;
59 cl_double *delta;
60 clMath::BlasBase *base;
61 bool useAlpha;
62 cl_event *events;
63 bool isComplex;
64
65 base = clMath::BlasBase::getInstance();
66 if ((typeid(T) == typeid(cl_double) ||
67 typeid(T) == typeid(DoubleComplex)) &&
68 !base->isDevSupportDoublePrecision()) {
69
70 std::cerr << ">> WARNING: The target device doesn't support native "
71 "double precision floating point arithmetic" <<
72 std::endl << ">> Test skipped" << std::endl;
73 SUCCEED();
74 return;
75 }
76
77 isComplex = ((typeid(T) == typeid(FloatComplex)) ||
78 (typeid(T) == typeid(DoubleComplex)));
79 if (canCaseBeSkipped(params, isComplex)) {
80 std::cerr << ">> Test is skipped" << std::endl;
81 SUCCEED();
82 return;
83 }
84
85 useAlpha = base->useAlpha();
86 alpha = ZERO<T>();
87
88 events = new cl_event[params->numCommandQueues];
89 memset(events, 0, params->numCommandQueues * sizeof(cl_event));
90
91 A = new T[params->rowsA * params->columnsA];
92 B = new T[params->rowsB * params->columnsB];
93 blasB = new T[params->rowsB * params->columnsB];
94 clblasB = new T[params->rowsB * params->columnsB];
95 delta = new cl_double[params->rowsB * params->columnsB];
96
97 srand(params->seed);
98 if (useAlpha) {
99 alpha = convertMultiplier<T>(params->alpha);
100 }
101
102 randomTrsmMatrices<T>(params->order, params->side, params->uplo,
103 params->diag, params->M, params->N, useAlpha,
104 &alpha, A, params->lda, B, params->ldb);
105
106 memcpy(blasB, B, params->rowsB * params->columnsB * sizeof(*B));
107 memcpy(clblasB, B, params->rowsB * params->columnsB * sizeof(*B));
108
109 if (params->order == clblasColumnMajor) {

Callers

nothing calls this directly

Calls 10

canCaseBeSkippedFunction · 0.85
printTestParamsFunction · 0.85
useAlphaMethod · 0.80
createEnqueueBufferMethod · 0.80
commandQueuesMethod · 0.80
alphaMethod · 0.80
releaseMemObjectsFunction · 0.70
trsmFunction · 0.50
waitForSuccessfulFinishFunction · 0.50

Tested by

no test coverage detected