| 1206 | #endif |
| 1207 | |
| 1208 | int |
| 1209 | main(int argc, char *argv[]) |
| 1210 | { |
| 1211 | int ret; |
| 1212 | int fn; |
| 1213 | gflops_t gflops1, gflops2; |
| 1214 | gbps_t gbps1,gbps2; |
| 1215 | double ratio; |
| 1216 | const char *name; |
| 1217 | ::clMath::BlasBase *base; |
| 1218 | TestParams params; |
| 1219 | #if 0 |
| 1220 | BlasFunction estimFuncs[][2] = { |
| 1221 | {FN_SGEMM, FN_CGEMM }, // FN_STRMM, FN_CTRMM}, |
| 1222 | {FN_DGEMM, FN_ZGEMM } // FN_DTRMM, FN_ZTRMM}}; |
| 1223 | }; |
| 1224 | const char *message[2] = { |
| 1225 | "Check if the resulting average ratio for single float types " |
| 1226 | "(for GEMM and TRMM) matches the expected one ", |
| 1227 | "Check if the resulting average ratio for double float " |
| 1228 | "precision types (for GEMM and TRMM) matches the expected one "}; |
| 1229 | double estimRatios[2] = { |
| 1230 | EXPECTED_SINGLE_FLOAT_PERF_RATIO, |
| 1231 | EXPECTED_DOUBLE_FLOAT_PERF_RATIO}; |
| 1232 | #endif |
| 1233 | |
| 1234 | if ((argc > 1) && !strcmp(argv[1], "--test-help")) { |
| 1235 | printUsage("test-performance"); |
| 1236 | return 0; |
| 1237 | } |
| 1238 | |
| 1239 | ::testing::InitGoogleTest(&argc, argv); |
| 1240 | ::std::cerr << "Initialize OpenCL and CLBLAS..." << ::std::endl; |
| 1241 | base = ::clMath::BlasBase::getInstance(); |
| 1242 | if (base == NULL) { |
| 1243 | ::std::cerr << "Fatal error, OpenCL or clblas initialization failed! " |
| 1244 | "Leaving the test." << ::std::endl; |
| 1245 | return -1; |
| 1246 | } |
| 1247 | |
| 1248 | base->setSeed(DEFAULT_SEED); |
| 1249 | |
| 1250 | if (argc > 1) { |
| 1251 | params.optFlags = NO_FLAGS; |
| 1252 | params.devType = CL_DEVICE_TYPE_GPU; |
| 1253 | params.devName = NULL; |
| 1254 | if (parseBlasCmdLineArgs(argc, argv, ¶ms) != 0) { |
| 1255 | printUsage(argv[0]); |
| 1256 | return 1; |
| 1257 | } |
| 1258 | if (params.optFlags & SET_SEED) { |
| 1259 | base->setSeed(params.seed); |
| 1260 | } |
| 1261 | if (params.optFlags & SET_ALPHA) { |
| 1262 | base->setAlpha(params.alpha); |
| 1263 | } |
| 1264 | if (params.optFlags & SET_BETA) { |
| 1265 | base->setBeta(params.beta); |
nothing calls this directly
no test coverage detected