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

Function calcNrThreads

src/library/blas/gens/gemm_tail_cached.cpp:190–291  ·  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 size_t tailM, tailN, M, N;
200 size_t Y, X;
201 size_t nWorkGroupsAY, nWorkGroupsAX, nWorkGroupsA;
202 size_t nWorkGroupsBY, nWorkGroupsBX, nWorkGroupsB;
203 size_t totalWorkGroups;
204 #ifdef DEBUG_GEMM_TAIL
205 printf("calcNrThreads called from gemm_tail.cpp\n");
206 #endif
207 const CLBlasKargs *kargs = (const CLBlasKargs *)args;
208 const CLBLASKernExtra *kextra = ( CLBLASKernExtra *)extra;
209 KernelExtraFlags kflags = kextra->flags;
210
211 //
212 // RowMajor GEMM can be expressed in terms of Column Major GEMM
213 //
214 if ((kflags & KEXTRA_COLUMN_MAJOR) == 0)
215 {
216 printf("calcNrThreads: FIXME: RowMajor is NOT supported \n");
217 return;
218 }
219
220 if (kextra->vecLenA != 1)
221 {
222 printf("GEMM_TAIL: calcNrThreads(): Vector Length must be 1 for TAIL. Non-one Vector Length Requested\n");
223 return;
224 }
225
226 tailM = kargs->tailStartM;
227 tailN = kargs->tailStartN;
228 M = kargs->M;
229 N = kargs->N;
230
231 Y = 8;
232 if (Y != subdims->y)
233 {
234 Y = subdims->y;
235 }
236 X = BLOCKSIZE/Y;
237 /*
238 LEGACY CODE: Outdated now. TAIL can handle this condition now using MTAIL_PRESENT and NTAIL_PRESENT
239 if (tailN % X)
240 {
241 printf("GEMM_TAIL: calcNrThreads(): WARNING: tailN is not divisible by X. Will produce Wrong results!\n");
242 }
243 */
244
245 //
246 // A Tail Workgroup will process YxX panel
247 //

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected