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

Function kgenDeclareLocalID

src/library/common/kgen_basic.c:323–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323int
324kgenDeclareLocalID(
325 struct KgenContext *ctx,
326 const char *lidName,
327 const PGranularity *pgran)
328{
329 char tmp[128];
330 int r;
331
332 if (pgran->wgDim == 1) {
333 sprintf(tmp, "const int %s = get_local_id(0);\n", lidName);
334 }
335 else {
336 sprintf(tmp, "const int %s = get_local_id(1) * %u + "
337 "get_local_id(0);\n",
338 lidName, pgran->wgSize[0]);
339 }
340
341 r = kgenAddStmt(ctx, tmp);
342
343 return (r) ? -EOVERFLOW : 0;
344}
345
346int
347kgenDeclareGroupID(

Callers 7

generatorFunction · 0.85
declareLocalVariablesFunction · 0.85
genPrepKernelAFunction · 0.85
copyDBlockGenericGenFunction · 0.85
copyDBlockOptimGenFunction · 0.85
f4zeroBlockGenFunction · 0.85

Calls 1

kgenAddStmtFunction · 0.85

Tested by

no test coverage detected