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

Method areResourcesSufficient

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

Source from the content-addressed store, hash-verified

169 * run the test case
170 */
171template <typename ElemType> bool
172SymvPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
173{
174 clMath::BlasBase *base;
175 size_t gmemSize, allocSize, maxMatrSize;
176 size_t n = params->N;
177
178 base = clMath::BlasBase::getInstance();
179 gmemSize = (size_t)base->availGlobalMemSize(0);
180 allocSize = (size_t)base->maxMemAllocSize();
181
182 if((A_ == NULL) || (backC_ == NULL) || (C_ == NULL) || (B_ == NULL))
183 {
184 return 0; // Not enough memory for host arrays
185 }
186
187
188 maxMatrSize = gmemSize / 3;
189
190 maxMatrSize = std::min(maxMatrSize, allocSize);
191
192 return (n * n * sizeof(ElemType) < maxMatrSize);
193}
194
195template <typename ElemType> int
196SymvPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected