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

Function assignKargs

src/library/blas/gens/trmv_reg.cpp:404–455  ·  view source on GitHub ↗

(__global %TYPE const* restrict A, __global %TYPE * _xnew, __global %TYPE const* restrict _x_vector, uint N, int incx, int isUnity, uint lda, int doConj, uint offa, uint offx) */

Source from the content-addressed store, hash-verified

402 int incx, int isUnity, uint lda, int doConj, uint offa, uint offx)
403*/
404static void
405assignKargs(KernelArg *args, const void *params, const void* )
406{
407 CLBlasKargs *blasArgs = (CLBlasKargs*)params;
408
409 //NOTE: This will not work if SolutionStep->args is not passed in const void *params.
410 SolutionStep *step = container_of(blasArgs, args, SolutionStep);
411
412 cl_int inc;
413 cl_int unity, doConj;
414 //bool incxOne = (blasArgs->ldb.vector == 1);
415 //bool incyOne = (blasArgs->ldc.vector == 1);
416
417 INIT_KARG(&args[0], blasArgs->A); //A - input matrix - argument
418 if( (step->funcID == CLBLAS_HEMV) || (blasArgs->pigFuncID == CLBLAS_HPMV) || (blasArgs->pigFuncID == CLBLAS_SPMV) )
419 {
420 INIT_KARG(&args[1], blasArgs->C); //y - since the 2nd argument is the result buffer, we should send y for HEMV
421 INIT_KARG(&args[2], blasArgs->B); //x - actual x vector argument
422 }
423 else
424 {
425 INIT_KARG(&args[1], blasArgs->B); //x - result buffer = _xnew argument
426 INIT_KARG(&args[2], blasArgs->C); //y - scratch == _x_vector argument
427 }
428 initSizeKarg(&args[3], blasArgs->N);
429 inc = blasArgs->ldb.Vector;
430 INIT_KARG(&args[4], inc);
431 unity = (blasArgs->diag == clblasUnit);
432 INIT_KARG(&args[5], unity);
433 initSizeKarg(&args[6], blasArgs->lda.matrix);
434 doConj = (blasArgs->transA == clblasConjTrans);
435
436 #ifdef DEBUG_TRMV
437 printf("doConj is : %d, unity is : %d, incx is : %d\n", doConj, unity, inc);
438 #endif
439
440 INIT_KARG(&args[7], doConj);
441 initSizeKarg(&args[8], blasArgs->offa);
442 initSizeKarg(&args[9], blasArgs->offBX);
443
444 // For HEMV both alpha and beta has to be passed.
445 if( (step->funcID == CLBLAS_HEMV) || (blasArgs->pigFuncID == CLBLAS_HPMV) || (blasArgs->pigFuncID == CLBLAS_SPMV) )
446 {
447 inc = blasArgs->ldc.Vector;
448 INIT_KARG(&args[10], inc);
449 initSizeKarg(&args[11], blasArgs->offCY);
450 assignScalarKarg(&args[12], &(blasArgs->alpha), blasArgs->dtype);
451 assignScalarKarg(&args[13], &(blasArgs->beta), blasArgs->dtype);
452 }
453
454 return;
455}
456
457static bool
458isFitToLDS(

Callers

nothing calls this directly

Calls 2

initSizeKargFunction · 0.85
assignScalarKargFunction · 0.85

Tested by

no test coverage detected