| 164 | * run the test case |
| 165 | */ |
| 166 | template <typename ElemType> bool |
| 167 | Spr2PerformanceTest<ElemType>::areResourcesSufficient(TestParams *params) |
| 168 | { |
| 169 | clMath::BlasBase *base; |
| 170 | size_t gmemSize, allocSize; |
| 171 | size_t n = params->N; |
| 172 | |
| 173 | if((AP_ == NULL) || (backAP_ == NULL) || (X_ == NULL) || (Y_ == NULL)) |
| 174 | { |
| 175 | return 0; |
| 176 | } |
| 177 | |
| 178 | base = clMath::BlasBase::getInstance(); |
| 179 | gmemSize = (size_t)base->availGlobalMemSize(0); |
| 180 | allocSize = (size_t)base->maxMemAllocSize(); |
| 181 | |
| 182 | bool suff = ( (sizeof(ElemType)*( params_.N*( params_.N + 1 ) )/2 )< allocSize ) && ((1 + (n-1)*abs(params->incx))*sizeof(ElemType) < allocSize) |
| 183 | && ((1 + (n-1)*abs(params->incy))*sizeof(ElemType) < allocSize); //for individual allocations |
| 184 | suff = suff && (((( ( params_.N*( params_.N + 1 ) )/2 )+ (1 + (n-1)*abs(params->incx)) + (1 + (n-1)*abs(params->incy)))*sizeof(ElemType)) < gmemSize) ; //for total global allocations |
| 185 | |
| 186 | return suff ; |
| 187 | } |
| 188 | |
| 189 | template <typename ElemType> int |
| 190 | Spr2PerformanceTest<ElemType>::prepare(void) |
no test coverage detected