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

Method generate

src/library/tools/ktest/step.cpp:245–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245std::string
246Step::generate()
247{
248 ssize_t size;
249 char *buf;
250 std::stringstream ss;
251
252 if ((pattern_->sops == NULL) || (pattern_->sops->genKernel == NULL)) {
253 return "";
254 }
255
256 ss << "/*" << std::endl;
257 for (int i = 0; i < MAX_SUBDIMS; i++) {
258 ss << "SubproblemDim[" << i << "]" << std::endl;
259 ss << dumpSubdim(step_.subdims + i) << std::endl;
260 }
261 ss << "PGranularity" << std::endl;
262 ss << dumpPgran() << std::endl;
263 ss << "CLBLASKernExtra" << std::endl;
264 ss << dumpKextra() << std::endl;
265 ss << "MemoryPattern" << std::endl;
266 ss << dumpMemoryPattern();
267 ss << "*/" << std::endl << std::endl;
268
269 size = pattern_->sops->genKernel(NULL, 0, step_.subdims, &step_.pgran,
270 static_cast<void*>(&kextra_));
271 if (size <= 0) {
272 return 0;
273 }
274 buf = new char[size + 1];
275 if (pattern_->sops->genKernel(buf, size, step_.subdims, &step_.pgran,
276 static_cast<void*>(&kextra_)) != size) {
277 delete[] buf;
278 return "";
279 }
280 ss << buf;
281
282 delete[] buf;
283 return ss.str();
284}
285
286void
287Step::setKargs(const CLBlasKargs& kargs)

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected