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

Function calcNrThreads

src/library/blas/gens/her_lds.cpp:190–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static void
191calcNrThreads(
192 size_t threads[2],
193 const SubproblemDim *subdims,
194 const PGranularity *pgran,
195 const void *args,
196 const void *_extra)
197{
198 int BLOCKSIZE = pgran->wgSize[0]; // 1D Block
199 #ifdef DEBUG_HER
200 printf("calcNrThreads called from her_lds.cpp\n");
201 #endif
202
203 const CLBlasKargs *kargs = (const CLBlasKargs *)args;
204 const CLBLASKernExtra *extra;
205 extra = ( CLBLASKernExtra *)_extra;
206
207 #ifdef DEBUG_HER
208 printf("subdims->y : %d, subdims->x : %d\n", (int)subdims->y, (int)subdims->x);
209 #endif
210 size_t TARGETROWS = subdims->y ;
211
212 #ifdef DEBUG_HER
213 printf("kargs-> N : %d, TARGETROWS: %d\n", (int)kargs->N, TARGETROWS);
214 #endif
215
216 size_t blocks = ((kargs->N - 1)/ TARGETROWS) + 1;
217 #ifdef DEBUG_HER
218 printf("blocks : %d\n", blocks);
219 #endif
220
221 threads[0] = ((blocks * (blocks + 1)) / 2) * BLOCKSIZE;
222 #ifdef DEBUG_HER
223 printf("pgran-wgSize[0] : %d, globalthreads[0] : %d\n", (int)pgran->wgSize[0], (int)threads[0]);
224 #endif
225 threads[1] = 1;
226}
227
228//
229// FIXME: Report correct return value - Needs change in KPRINTF

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected