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

Function getDefaultDecomposition

src/library/blas/gens/ger_lds.cpp:362–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362static int
363getDefaultDecomposition(
364 PGranularity *pgran,
365 SubproblemDim *subdims,
366 unsigned int subdimsNum,
367 void *pArgs)
368{
369 SolutionStep *step = container_of( pgran , pgran, SolutionStep);
370 size_t maxWorkGroupSize;
371 cl_device_id devID = step->device.id;
372 size_t wgX, wgY;
373 pArgs = pArgs;
374
375 clGetDeviceInfo(devID, CL_DEVICE_MAX_WORK_GROUP_SIZE,
376 sizeof(size_t), &maxWorkGroupSize, NULL);
377
378 if( step->args.order == clblasColumnMajor )
379 {
380 wgY = 16; // BH preferably 16(quarter wave-front)
381 subdims[0].y = wgY;
382 wgX = maxWorkGroupSize / wgY; // BW is left upto maxWorkGroupSize of the device
383 wgX = szmin( wgX, 16 );
384 subdims[0].x = wgX;
385 }
386 else {
387 wgX = 16;
388 subdims[0].x = wgX;
389 wgY = maxWorkGroupSize / wgX;
390 wgY = szmin( wgY, 16 );
391 subdims[0].y = wgY;
392 }
393
394 pgran->wgDim = 1; //1D blocking
395 pgran->wgSize[0] = (unsigned int)(wgX * wgY);
396 pgran->wgSize[1] = 1;
397
398 if(subdimsNum > 0)
399 {
400 subdims[0].itemX = subdims[0].x;
401 subdims[0].itemY = subdims[0].y;
402 subdims[0].bwidth = 1;
403 }
404 if(subdimsNum > 1)
405 {
406 subdims[1].itemY = 1;
407 subdims[1].itemX = 1;
408 subdims[1].y = subdims[1].itemY;
409 subdims[1].x = subdims[1].itemX;
410 subdims[1].bwidth = 1;
411 }
412
413 return 0;
414}

Callers

nothing calls this directly

Calls 1

szminFunction · 0.85

Tested by

no test coverage detected