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

Method areResourcesSufficient

src/tests/performance/perf-ger.cpp:171–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 * run the test case
170 */
171template <typename ElemType> bool
172GerPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
173{
174 clMath::BlasBase *base;
175 size_t gmemSize, allocSize;
176 bool ret;
177 size_t m = params->M, n = params->N;
178
179 if((A_ == NULL) || (backA_ == NULL) || (x_ == NULL) || (y_ == 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 ret = std::max(m, n) * params_.lda * sizeof(ElemType) < allocSize;
189 ret = ret && ( ((1 + (params_.M-1)*abs(params_.incx)))* sizeof(ElemType) < allocSize);
190 ret = ret && ( ((1 + (params_.N-1)*abs(params_.incy))) * sizeof(ElemType) < allocSize);
191
192 ret = ret && (((std::max(m, n) * params_.lda) + ((1 + (params_.M-1)*abs(params_.incx))) + ((1 + (params_.N-1)*abs(params_.incy)))) < gmemSize);
193
194 return ret;
195}
196
197template <typename ElemType> int
198GerPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected