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

Method runInstance

src/tests/performance/perf-gemm.cpp:68–104  ·  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 GemmPerformanceTest<ElemType> perfCase(fn, params);
71 int ret = 0;
72 int opFactor;
73 BlasBase *base;
74
75 base = clMath::BlasBase::getInstance();
76
77 if (fn == FN_SGEMM || fn == FN_DGEMM) {
78 opFactor = 2;
79 }
80 else {
81 opFactor = 8;
82 }
83
84 if ((fn == FN_DGEMM || fn == FN_ZGEMM) &&
85 !base->isDevSupportDoublePrecision()) {
86
87 std::cerr << ">> WARNING: The target device doesn't support native "
88 "double precision floating point arithmetic" <<
89 std::endl << ">> Test skipped" << std::endl;
90 return;
91 }
92
93 if (!perfCase.areResourcesSufficient(params)) {
94 std::cerr << ">> RESOURCE CHECK: Skip due to unsufficient resources" <<
95 std::endl;
96 }
97 else {
98 ret = perfCase.run(opFactor);
99 }
100
101 ASSERT_GE(ret, 0) << "Fatal error: can not allocate resources or "
102 "perform an OpenCL request!" << endl;
103 EXPECT_EQ(0, ret) << "The OpenCL version is slower in the case" << endl;
104 }
105
106private:
107 GemmPerformanceTest(BlasFunction fn, TestParams *params);

Callers

nothing calls this directly

Calls 3

runMethod · 0.45

Tested by

no test coverage detected