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

Method areResourcesSufficient

src/tests/performance/perf-axpy.cpp:180–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 * run the test case
179 */
180template <typename ElemType> bool
181AxpyPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
182{
183 clMath::BlasBase *base;
184 size_t gmemSize, allocSize, reqdSize;
185 bool ret;
186
187 if((X_ == NULL) || (blasX_ == NULL) || (Y_ == NULL) || (blasY_ == NULL))
188 {
189 return 0;
190 }
191
192 base = clMath::BlasBase::getInstance();
193 gmemSize = (size_t)base->availGlobalMemSize( 0 );
194 allocSize = (size_t)base->maxMemAllocSize();
195 reqdSize = (lengthX + params->offBX + lengthY + params->offCY) * sizeof(ElemType);
196
197 ret = (reqdSize) < allocSize;
198 ret = ret && (reqdSize < gmemSize);
199
200 return ret;
201}
202
203template <typename ElemType> int
204AxpyPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected