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

Function assertGranulation

src/library/blas/generic/solution_assert.c:39–77  ·  view source on GitHub ↗

check the found dimensions are not wrong

Source from the content-addressed store, hash-verified

37
38// check the found dimensions are not wrong
39void VISIBILITY_HIDDEN
40assertGranulation(
41 SubproblemDim *dims,
42 unsigned int nrDims,
43 PGranularity *pgran,
44 unsigned int thLevel)
45{
46 unsigned int i;
47 size_t gsize;
48
49 /*
50 * subproblem dimensions on all levels must meet the following requirements:
51 *
52 * 1) Item work piece is greater then a processing step
53 * 2) Item work piece is integrally divisible on the processing step
54 * 3) Work pieces and processing steps don't grows at forwarding to the bottom level
55 * 4) At passing to the thread level, the subproblem must be strict divisible among
56 * all the threads
57 */
58
59 gsize = pgran->wgSize[0] * pgran->wgSize[1];
60
61 for (i = 0; i < nrDims; i++) {
62 if (i || dims[i].itemX != SUBDIM_UNUSED) {
63 ASSERT_GREQ_AND_DIV(dims[i].itemX, dims[i].x);
64 }
65 if (i || dims[i].itemY != SUBDIM_UNUSED) {
66 ASSERT_GREQ_AND_DIV(dims[i].itemY, dims[i].y);
67 }
68 if (i) {
69 ASSERT_GREQ_AND_DIV(dims[i - 1].x, dims[i].itemX);
70 ASSERT_GREQ_AND_DIV(dims[i - 1].y, dims[i].itemY);
71 ASSERT_GREQ_AND_DIV(dims[i - 1].bwidth, dims[i].bwidth);
72 }
73 }
74
75 assert((dims[thLevel].itemX * dims[thLevel].itemY) * gsize ==
76 dims[thLevel - 1].x * dims[thLevel - 1].y);
77}
78
79#endif // ASSERT_GRANULATION
80

Callers 1

findBestPatternFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected