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

Function initGenPriv

src/library/common/gens/dblock_kgen.c:296–327  ·  view source on GitHub ↗

* Partial initialization of the generator private information */

Source from the content-addressed store, hash-verified

294 * Partial initialization of the generator private information
295 */
296static void
297initGenPriv(
298 GenPriv *priv,
299 DataType dtype,
300 unsigned int typeSize,
301 const SubproblemDim *dim,
302 DBlockCopyDirection dir,
303 const ItemWork *work,
304 const PGranularity *pgran)
305{
306 unsigned int gsize;
307
308 priv->dtype = dtype;
309 priv->typeSize = typeSize;
310 priv->nfloats = typeSize / sizeof(float);
311 priv->dim = dim;
312 priv->dir = dir;
313 priv->work = work;
314 priv->cnt = 0;
315 priv->vecLen = FLOAT4_VECLEN;
316 if (dir == DBLOCK_GLOBAL_TO_LOCAL || dir == DBLOCK_LOCAL_TO_GLOBAL) {
317 gsize = pgran->wgSize[0] * pgran->wgSize[1];
318 priv->vecLen = (unsigned int)(dim->x * dim->y * priv->nfloats / gsize);
319
320 if (priv->vecLen < 1) {
321 priv->vecLen = 1;
322 } else if (priv->vecLen > 4) {
323 priv->vecLen = FLOAT4_VECLEN;
324 }
325 }
326
327}
328
329/*
330 * get info about work to be done by the work group

Callers 2

copyDataBlockGenFunction · 0.85
f4zeroBlockGenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected