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

Function main

src/library/tools/ktest/main.cpp:56–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 const char *name);
55
56int
57main(int argc, char *argv[])
58{
59 clMath::Config cfg;
60 cfg.setDefaultConfig("ktest.cfg");
61 if (!cfg.parseCommandLine(argc, argv) || !cfg.isSane()) {
62 return 1;
63 }
64
65 clblasSetup();
66 parseEnvImplementation();
67
68 clMath::Step *masterStep = getMasterStep(cfg.blasFunctionID(),
69 cfg.platform(), cfg.device());
70 if (masterStep == NULL) {
71 std::cerr << "Function support not implemented yet" << std::endl;
72 return 1;
73 }
74
75 CLBlasKargs kargs;
76 SubproblemDim subdims[MAX_SUBDIMS];
77
78 cfg.kargs(&kargs);
79 masterStep->setKargs(kargs);
80 masterStep->fixLD();
81
82 ListHead seq;
83 listInitHead(&seq);
84 bool severalKernels = false;
85
86 /* Single kernel for this function */
87 if (cfg.decomposition(subdims)) {
88 masterStep->setDecomposition(subdims);
89 }
90 masterStep->completeDecompositionSingle();
91
92 if (cfg.permitMultiKernels()) {
93 masterStep->makeSolutionSequence(&seq,
94 getPlatform(cfg.platform().c_str()));
95 if (listLength(&seq) > 1) {
96 severalKernels = true;
97 }
98 }
99
100 if (severalKernels) {
101 std::ofstream fs;
102 ListNode *node;
103
104 std::vector<clMath::Step*> steps;
105
106 masterStep->declareVars(NULL);
107
108 for (node = listNodeFirst(&seq); node != &seq; node = node->next) {
109 steps.push_back(getStep(node));
110 }
111
112 std::string str;
113

Callers

nothing calls this directly

Calls 15

clblasSetupFunction · 0.85
parseEnvImplementationFunction · 0.85
getMasterStepFunction · 0.85
listInitHeadFunction · 0.85
listLengthFunction · 0.85
listNodeFirstFunction · 0.85
getStepFunction · 0.85
setDefaultConfigMethod · 0.80
parseCommandLineMethod · 0.80
isSaneMethod · 0.80
platformMethod · 0.80
kargsMethod · 0.80

Tested by

no test coverage detected