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

Method runInstance

src/tests/performance/perf-gemv.cpp:68–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 virtual nano_time_t clblasPerfSingle(void);
67
68 static void runInstance(BlasFunction fn, TestParams *params)
69 {
70 GemvPerformanceTest<ElemType> perfCase(fn, params);
71 int ret = 0;
72 int opFactor;
73 BlasBase *base;
74
75 base = clMath::BlasBase::getInstance();
76
77 switch (fn) {
78 case FN_SGEMV:
79 opFactor = sizeof(cl_float);
80 break;
81 case FN_DGEMV:
82 opFactor = sizeof(cl_double);
83 case FN_CGEMV:
84 opFactor = sizeof(FloatComplex);
85 break;
86 case FN_ZGEMV:
87 opFactor = sizeof(DoubleComplex);
88 break;
89 default:
90 break;
91 }
92
93 if ((fn == FN_DGEMV || fn == FN_ZGEMV) &&
94 !base->isDevSupportDoublePrecision()) {
95
96 std::cerr << ">> WARNING: The target device doesn't support native "
97 "double precision floating point arithmetic" <<
98 std::endl << ">> Test skipped" << std::endl;
99 return;
100 }
101
102 if (!perfCase.areResourcesSufficient(params)) {
103 std::cerr << ">> RESOURCE CHECK: Skip due to unsufficient resources" <<
104 std::endl;
105 }
106 else {
107 ret = perfCase.run(opFactor);
108 }
109
110 ASSERT_GE(ret, 0) << "Fatal error: can not allocate resources or "
111 "perform an OpenCL request!" << endl;
112 EXPECT_EQ(0, ret) << "The OpenCL version is slower in the case" << endl;
113 }
114
115private:
116 GemvPerformanceTest(BlasFunction fn, TestParams *params);

Callers

nothing calls this directly

Calls 3

runMethod · 0.45

Tested by

no test coverage detected