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

Method areResourcesSufficient

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

Source from the content-addressed store, hash-verified

156 }
157}
158template <typename ElemType> bool
159CopyPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
160{
161 clMath::BlasBase *base;
162 size_t gmemSize, allocSize;
163 bool ret;
164 size_t sizeX, sizeY;
165
166 if((blasX_ == NULL) || (blasY_ == NULL) || (backY_ ==NULL) ) {
167 return 0;
168 }
169
170 base = clMath::BlasBase::getInstance();
171 gmemSize = (size_t)base->availGlobalMemSize( 0 );
172 allocSize = (size_t)base->maxMemAllocSize();
173 sizeX = (lengthX + params->offBX) * sizeof(ElemType);
174 sizeY = (lengthY + params->offCY) * sizeof(ElemType);
175
176 ret = ((sizeX < allocSize) && (sizeY < allocSize));
177 ret = (ret && ((sizeX + sizeY) < gmemSize));
178
179 return ret;
180}
181
182template <typename ElemType> int
183CopyPerformanceTest<ElemType>::prepare(void)

Callers 1

runInstanceMethod · 0.45

Calls 2

availGlobalMemSizeMethod · 0.80
maxMemAllocSizeMethod · 0.80

Tested by

no test coverage detected