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

Method areResourcesSufficient

src/tests/performance/perf-her.cpp:157–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155 * run the test case
156 */
157template <typename ElemType> bool
158HerPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
159{
160 clMath::BlasBase *base;
161 size_t gmemSize, allocSize;
162 size_t n = params->N;
163
164 if((A_ == NULL) || (backA_ == NULL) || (X_ == NULL))
165 {
166 return 0;
167 }
168
169 base = clMath::BlasBase::getInstance();
170 gmemSize = (size_t)base->availGlobalMemSize(0);
171 allocSize = (size_t)base->maxMemAllocSize();
172
173 bool suff = ( sizeof(ElemType)*n*params->lda < allocSize ) && ((1 + (n-1)*abs(params->incx))*sizeof(ElemType) < allocSize); //for individual allocations
174 suff = suff && ((( n*params->lda + (1 + (n-1)*abs(params->incx))*2)*sizeof(ElemType)) < gmemSize) ; //for total global allocations
175
176 return suff ;
177}
178
179template <typename ElemType> int
180HerPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected