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

Method completeDecompositionSingle

src/library/tools/ktest/step.cpp:123–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void
124Step::completeDecompositionSingle()
125{
126 cl_int err;
127
128 kextra_.dtype = kargs().dtype;
129 kextra_.kernType = CLBLAS_COMPUTING_KERNEL;
130 kextra_.flags = (KernelExtraFlags)(kextra_.flags |
131 clblasArgsToKextraFlags(&step_.args, blasFunctionID()));
132 if (deviceVendor(device()) == "Advanced Micro Devices, Inc.") {
133 kextra_.flags = static_cast<KernelExtraFlags>
134 (kextra_.flags | KEXTRA_VENDOR_AMD | KEXTRA_ENABLE_MAD);
135 }
136
137 step_.pgran.wfSize = deviceWavefront(device(), &err);
138
139 step_.extraFlags = kextra_.flags;
140 step_.patternID = selectPattern(&step_, 0);
141 pattern_ = &clblasSolvers[step_.funcID].memPatterns[step_.patternID];
142
143 if (0 == step_.subdims[0].bwidth
144 && 0 == step_.subdims[0].bwidth
145 && 0 == step_.subdims[0].bwidth) {
146 getStepGranulation(&step_);
147
148 }
149 else if (pattern_->sops->checkCalcDecomp) {
150 pattern_->sops->checkCalcDecomp(&step_.pgran, step_.subdims, 2,
151 kextra_.dtype, PGRAN_CALC);
152 }
153 else {
154 size_t wgX, wgY;
155 size_t x0, y0;
156 SolverFlags sflags;
157
158 // Set up granulation for given dimensions
159
160 wgY = step_.subdims[0].y/ step_.subdims[1].y;
161 wgX = step_.subdims[0].x/ step_.subdims[1].x;
162
163 x0 = step_.subdims[0].x;
164 y0 = step_.subdims[0].y;
165
166 if (funcBlasLevel(blasFunctionID()) == 2) {
167 /* Level 2 decomposition size for vectors (dims[0].x) is 1.
168 * We have to "restore" it to proceed.
169 */
170 size_t xBlocks;
171
172 xBlocks = step_.subdims[0].bwidth / step_.subdims[1].bwidth;
173 x0 = step_.subdims[1].x * xBlocks;
174 }
175
176 /*
177 * adjust local size if a subproblem is not divisible
178 * between all local threads
179 */
180 for (; (wgY > 1) && (y0 < wgY); wgY /= 2) { }

Callers 1

mainFunction · 0.80

Calls 10

clblasArgsToKextraFlagsFunction · 0.85
deviceWavefrontFunction · 0.85
selectPatternFunction · 0.85
getStepGranulationFunction · 0.85
funcBlasLevelFunction · 0.85
detectProblemTailsFunction · 0.85
detectOffsetsFunction · 0.85
selectVectorizationFunction · 0.50

Tested by

no test coverage detected