| 279 | |
| 280 | |
| 281 | template <typename ElemType> nano_time_t |
| 282 | HemmPerformanceTest<ElemType>::clblasPerfSingle(void) |
| 283 | { |
| 284 | nano_time_t time; |
| 285 | cl_event event; |
| 286 | cl_int status; |
| 287 | cl_command_queue queue = base_->commandQueues()[0]; |
| 288 | |
| 289 | status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0, |
| 290 | (params_.ldc * kbc + params_.offCY) * sizeof(ElemType), backC_, 0, NULL, &event); |
| 291 | if (status != CL_SUCCESS) { |
| 292 | cerr << "Matrix C buffer object enqueuing error, status = " << |
| 293 | status << endl; |
| 294 | |
| 295 | return NANOTIME_ERR; |
| 296 | } |
| 297 | |
| 298 | status = clWaitForEvents(1, &event); |
| 299 | if (status != CL_SUCCESS) { |
| 300 | cout << "Wait on event failed, status = " << |
| 301 | status << endl; |
| 302 | |
| 303 | return NANOTIME_ERR; |
| 304 | } |
| 305 | |
| 306 | event = NULL; |
| 307 | |
| 308 | time = getCurrentTime(); |
| 309 | //#define TIMING |
| 310 | #ifdef TIMING |
| 311 | clFinish( queue); |
| 312 | |
| 313 | int iter = 20; |
| 314 | for ( int i = 1; i <= iter; i++) |
| 315 | { |
| 316 | #endif |
| 317 | status = (cl_int)clMath::clblas::hemm(params_.order, |
| 318 | params_.side, params_.uplo, params_.M, params_.N, alpha_, |
| 319 | mobjA_, params_.offA, params_.lda, mobjB_, params_.offBX, params_.ldb, beta_, mobjC_, params_.offCY, params_.ldc, 1, |
| 320 | &queue, 0, NULL, &event); |
| 321 | if (status != CL_SUCCESS) { |
| 322 | cerr << "The CLBLAS HEMM function failed, status = " << |
| 323 | status << endl; |
| 324 | return NANOTIME_ERR; |
| 325 | } |
| 326 | #ifdef TIMING |
| 327 | } // iter loop |
| 328 | clFinish( queue); |
| 329 | time = getCurrentTime() - time; |
| 330 | time /= iter; |
| 331 | #else |
| 332 | |
| 333 | status = flushAll(1, &queue); |
| 334 | if (status != CL_SUCCESS) { |
| 335 | cerr << "clFlush() failed, status = " << status << endl; |
| 336 | return NANOTIME_ERR; |
| 337 | } |
| 338 |
nothing calls this directly
no test coverage detected