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

Function generator

src/library/blas/gens/iamax.cpp:214–264  ·  view source on GitHub ↗

FIXME: Report correct return value - Needs change in KPRINTF

Source from the content-addressed store, hash-verified

212// FIXME: Report correct return value - Needs change in KPRINTF
213//
214static ssize_t
215generator(
216 char *buf,
217 size_t buflen,
218 const struct SubproblemDim *subdims,
219 const struct PGranularity *pgran,
220 void *extra)
221{
222
223 DUMMY_ARG_USAGE(subdims);
224 size_t BLOCKSIZE = pgran->wgSize[0];
225 char tempTemplate[32*1024];
226
227 if ( buf == NULL) // return buffer size
228 {
229 buflen = (32 * 1024 * sizeof(char));
230 return (ssize_t)buflen;
231 }
232 CLBLASKernExtra *extraFlags = ( CLBLASKernExtra *)extra;
233
234 #ifdef DEBUG_AMAX
235 printf("AMAX GENERATOR called....\n");
236 printf("dataType : %c\n", Prefix[extraFlags->dtype]);
237 #endif
238
239 unsigned int vecLenA = extraFlags->vecLenA;
240
241 #ifdef DEBUG_AMAX
242 printf("Vector length used : %d\n\n", vecLenA);
243 #endif
244
245 bool doVLOAD = false;
246 if( extraFlags->flags & KEXTRA_NO_COPY_VEC_A )
247 {
248 doVLOAD = true;
249 #ifdef DEBUG_AMAX
250 printf("DOing VLOAD as Aligned Data Pointer not Availabe\n");
251 #endif
252 }
253 else
254 {
255 #ifdef DEBUG_AMAX
256 printf("Using Aligned Data Pointer .........................\n");
257 #endif
258 }
259 strcpy( tempTemplate, (char*)iamax_kernel );
260 kprintf kobj( Prefix[extraFlags->dtype], vecLenA, doVLOAD, doVLOAD, BLOCKSIZE);
261 kobj.spit((char*)buf, tempTemplate);
262
263 return (32 * 1024 * sizeof(char));
264}
265
266/*
267__kernel void %PREFIXiamax_kernel( __global %TYPE *_X, __global %TYPE _scratchBuf, __global %TYPE *_iMax,

Callers

nothing calls this directly

Calls 1

spitMethod · 0.80

Tested by

no test coverage detected