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