| 293 | |
| 294 | |
| 295 | template <typename ElemType> nano_time_t |
| 296 | SymmPerformanceTest<ElemType>::clblasPerfSingle(void) |
| 297 | { |
| 298 | nano_time_t time; |
| 299 | cl_event event; |
| 300 | cl_int status; |
| 301 | cl_command_queue queue = base_->commandQueues()[0]; |
| 302 | |
| 303 | status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0, |
| 304 | (params_.ldc * kbc + params_.offc) * sizeof(ElemType), backC_, 0, NULL, &event); |
| 305 | if (status != CL_SUCCESS) { |
| 306 | cerr << "Matrix C buffer object enqueuing error, status = " << |
| 307 | status << endl; |
| 308 | |
| 309 | return NANOTIME_ERR; |
| 310 | } |
| 311 | |
| 312 | status = clWaitForEvents(1, &event); |
| 313 | if (status != CL_SUCCESS) { |
| 314 | cout << "Wait on event failed, status = " << |
| 315 | status << endl; |
| 316 | |
| 317 | return NANOTIME_ERR; |
| 318 | } |
| 319 | |
| 320 | event = NULL; |
| 321 | time = getCurrentTime(); |
| 322 | //#define TIMING |
| 323 | #ifdef TIMING |
| 324 | clFinish( queue); |
| 325 | |
| 326 | int iter = 20; |
| 327 | for ( int i = 1; i <= iter; i++) |
| 328 | { |
| 329 | #endif |
| 330 | status = (cl_int)clMath::clblas::symm(params_.order, |
| 331 | params_.side, params_.uplo, params_.M, params_.N, alpha_, |
| 332 | mobjA_, params_.offa, params_.lda, mobjB_, params_.offb, params_.ldb, beta_, mobjC_, params_.offc, params_.ldc, 1, |
| 333 | &queue, 0, NULL, &event); |
| 334 | if (status != CL_SUCCESS) { |
| 335 | cerr << "The CLBLAS SYMM function failed, status = " << |
| 336 | status << endl; |
| 337 | |
| 338 | return NANOTIME_ERR; |
| 339 | } |
| 340 | #ifdef TIMING |
| 341 | } // iter loop |
| 342 | clFinish( queue); |
| 343 | time = getCurrentTime() - time; |
| 344 | time /= iter; |
| 345 | #else |
| 346 | |
| 347 | status = flushAll(1, &queue); |
| 348 | if (status != CL_SUCCESS) { |
| 349 | cerr << "clFlush() failed, status = " << status << endl; |
| 350 | return NANOTIME_ERR; |
| 351 | } |
| 352 |
nothing calls this directly
no test coverage detected