| 252 | } |
| 253 | |
| 254 | template <typename ElemType> int |
| 255 | RotmgPerformanceTest<ElemType>::prepare(void) |
| 256 | { |
| 257 | //Filling random values for SA and SB. C & S are only for output sake |
| 258 | randomRotmg( (D1_ + params_.offa), (D2_ + params_.offb), |
| 259 | (X_ + params_.offBX), (Y_ + params_.offCY), (PARAM_ + params_.offc) ); |
| 260 | |
| 261 | ElemType sflagParam = convertMultiplier<ElemType>(params_.alpha); |
| 262 | PARAM_[params_.offc] = sflagParam; // initializing first element |
| 263 | |
| 264 | memcpy(back_D1_, D1_, (1 + params_.offa)*sizeof(ElemType)); |
| 265 | memcpy(back_D2_, D2_, (1 + params_.offb)*sizeof(ElemType)); |
| 266 | memcpy(back_X_, X_, (1 + params_.offBX)*sizeof(ElemType)); |
| 267 | memcpy(back_Y_, Y_, (1 + params_.offCY)*sizeof(ElemType)); |
| 268 | memcpy(back_PARAM_, PARAM_, (5 + params_.offc)*sizeof(ElemType)); |
| 269 | |
| 270 | // Allocate buffers |
| 271 | mobjX_ = base_->createEnqueueBuffer(X_, (1 + params_.offBX) * sizeof(ElemType), 0, CL_MEM_READ_WRITE); |
| 272 | mobjY_ = base_->createEnqueueBuffer(Y_, (1 + params_.offCY) * sizeof(ElemType), 0, CL_MEM_READ_ONLY); |
| 273 | mobjD1_ = base_->createEnqueueBuffer(D1_, (1 + params_.offa) * sizeof(ElemType), 0, CL_MEM_READ_WRITE); |
| 274 | mobjD2_ = base_->createEnqueueBuffer(D2_, (1 + params_.offb) * sizeof(ElemType), 0, CL_MEM_READ_WRITE); |
| 275 | mobjParam_ = base_->createEnqueueBuffer(PARAM_, (5 + params_.offc) * sizeof(ElemType), 0, CL_MEM_READ_ONLY); |
| 276 | |
| 277 | if((mobjD1_ == NULL) || (mobjD2_ == NULL) || (mobjX_ == NULL) || (mobjY_ == NULL) || (mobjParam_ == NULL)) |
| 278 | { |
| 279 | return -1; |
| 280 | } |
| 281 | return 0; |
| 282 | } |
| 283 | |
| 284 | template <typename ElemType> nano_time_t |
| 285 | RotmgPerformanceTest<ElemType>::etalonPerfSingle(void) |
nothing calls this directly
no test coverage detected