| 155 | * run the test case |
| 156 | */ |
| 157 | template <typename ElemType> bool |
| 158 | HerPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params) |
| 159 | { |
| 160 | clMath::BlasBase *base; |
| 161 | size_t gmemSize, allocSize; |
| 162 | size_t n = params->N; |
| 163 | |
| 164 | if((A_ == NULL) || (backA_ == NULL) || (X_ == NULL)) |
| 165 | { |
| 166 | return 0; |
| 167 | } |
| 168 | |
| 169 | base = clMath::BlasBase::getInstance(); |
| 170 | gmemSize = (size_t)base->availGlobalMemSize(0); |
| 171 | allocSize = (size_t)base->maxMemAllocSize(); |
| 172 | |
| 173 | bool suff = ( sizeof(ElemType)*n*params->lda < allocSize ) && ((1 + (n-1)*abs(params->incx))*sizeof(ElemType) < allocSize); //for individual allocations |
| 174 | suff = suff && ((( n*params->lda + (1 + (n-1)*abs(params->incx))*2)*sizeof(ElemType)) < gmemSize) ; //for total global allocations |
| 175 | |
| 176 | return suff ; |
| 177 | } |
| 178 | |
| 179 | template <typename ElemType> int |
| 180 | HerPerformanceTest<ElemType>::prepare(void) |
no test coverage detected