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

Method areResourcesSufficient

src/tests/performance/perf-dot.cpp:168–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 * run the test case
167 */
168template <typename ElemType> bool
169DotPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
170{
171 clMath::BlasBase *base;
172 size_t gmemSize, allocSize;
173 bool ret;
174 size_t sizeX, sizeY, sizeDP;
175
176 if((blasX_ == NULL) || (blasY_ == NULL) ) {
177 return 0;
178 }
179
180 base = clMath::BlasBase::getInstance();
181 gmemSize = (size_t)base->availGlobalMemSize( 0 );
182 allocSize = (size_t)base->maxMemAllocSize();
183 sizeX = (lengthX + params->offBX) * sizeof(ElemType);
184 sizeY = (lengthY + params->offCY) * sizeof(ElemType);
185 sizeDP = (1 + params->offa) * sizeof(ElemType);
186
187 ret = ((sizeX < allocSize) && (sizeY < allocSize) && (sizeDP < allocSize));
188 ret = (ret && ((sizeX + sizeY + sizeDP) < gmemSize));
189
190 return ret;
191}
192
193template <typename ElemType> int
194DotPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected