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

Method areResourcesSufficient

src/tests/performance/perf-hpmv.cpp:172–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 * run the test case
171 */
172template <typename ElemType> bool
173HpmvPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
174{
175 clMath::BlasBase *base;
176 size_t gmemSize, allocSize;
177 size_t n = params->N;
178
179 if((AP_ == NULL) || (X_ == NULL) || (Y_ == NULL) || (backY_ == NULL))
180 {
181 return 0;
182 }
183
184 base = clMath::BlasBase::getInstance();
185 gmemSize = (size_t)base->availGlobalMemSize( 0 );
186 allocSize = (size_t)base->maxMemAllocSize();
187
188 bool suff = ( sizeof(ElemType)*((n*(n+1))/2) < allocSize ) && ((1 + (n-1)*abs(params->incx))*sizeof(ElemType) < allocSize); //for individual allocations
189 suff = suff && ((( ((n*(n+1))/2) + (1 + (n-1)*abs(params->incx)) + (1 + (n-1)*abs(params->incy)))*sizeof(ElemType)) < gmemSize) ; //for total global allocations
190
191 return suff ;
192}
193
194template <typename ElemType> int
195HpmvPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected