| 170 | * run the test case |
| 171 | */ |
| 172 | template <typename ElemType> bool |
| 173 | HpmvPerformanceTest<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 | |
| 194 | template <typename ElemType> int |
| 195 | HpmvPerformanceTest<ElemType>::prepare(void) |
no test coverage detected