| 258 | |
| 259 | |
| 260 | template <typename ElemType> nano_time_t |
| 261 | Hpr2PerformanceTest<ElemType>::clblasPerfSingle(void) |
| 262 | { |
| 263 | nano_time_t time; |
| 264 | cl_event event; |
| 265 | cl_int status; |
| 266 | cl_command_queue queue = base_->commandQueues()[0]; |
| 267 | |
| 268 | status = clEnqueueWriteBuffer(queue, mobjAP_, CL_TRUE, 0, |
| 269 | (((params_.N * (params_.N + 1))/2) + params_.offa) * |
| 270 | sizeof(ElemType), backAP_, 0, NULL, &event); |
| 271 | if (status != CL_SUCCESS) { |
| 272 | cerr << "Matrix A buffer object enqueuing error, status = " << |
| 273 | status << endl; |
| 274 | |
| 275 | return NANOTIME_ERR; |
| 276 | } |
| 277 | |
| 278 | status = clWaitForEvents(1, &event); |
| 279 | if (status != CL_SUCCESS) { |
| 280 | cout << "Wait on event failed, status = " << |
| 281 | status << endl; |
| 282 | |
| 283 | return NANOTIME_ERR; |
| 284 | } |
| 285 | |
| 286 | event = NULL; |
| 287 | |
| 288 | #define TIMING |
| 289 | #ifdef TIMING |
| 290 | clFinish( queue); |
| 291 | time = getCurrentTime(); |
| 292 | |
| 293 | int iter = 20; |
| 294 | for ( int i = 1; i <= iter; i++) |
| 295 | { |
| 296 | #endif |
| 297 | status = (cl_int)clMath::clblas::hpr2(params_.order, params_.uplo, params_.N, alpha_, mobjX_, params_.offBX, params_.incx, |
| 298 | mobjY_, params_.offCY, params_.incy, mobjAP_, params_.offa, 1, &queue, 0, NULL, &event); |
| 299 | |
| 300 | if (status != CL_SUCCESS) { |
| 301 | cerr << "The CLBLAS HPR2 function failed, status = " << |
| 302 | status << endl; |
| 303 | |
| 304 | return NANOTIME_ERR; |
| 305 | } |
| 306 | |
| 307 | #ifdef TIMING |
| 308 | } // iter loop |
| 309 | clFinish( queue); |
| 310 | time = getCurrentTime() - time; |
| 311 | time /= iter; |
| 312 | #else |
| 313 | status = flushAll(1, &queue); |
| 314 | if (status != CL_SUCCESS) { |
| 315 | cerr << "clFlush() failed, status = " << status << endl; |
| 316 | return NANOTIME_ERR; |
| 317 | } |
nothing calls this directly
no test coverage detected