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

Function main

src/tests/performance/test-performance.cpp:1208–1406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1206#endif
1207
1208int
1209main(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, &params) != 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);

Callers

nothing calls this directly

Calls 15

parseBlasCmdLineArgsFunction · 0.85
parseEnvFunction · 0.85
functionToStringFunction · 0.85
isDoubleZeroFunction · 0.85
functionBlasLevelFunction · 0.85
checkIsTrmmFasterFunction · 0.85
setSeedMethod · 0.80
setDeviceTypeMethod · 0.80
setNumCommandQueuesMethod · 0.80
setUseImagesMethod · 0.80
useImagesMethod · 0.80
removeScratchImagesMethod · 0.80

Tested by

no test coverage detected