| 256 | |
| 257 | |
| 258 | template <typename ElemType> nano_time_t |
| 259 | SymvPerformanceTest<ElemType>::clblasPerfSingle(void) |
| 260 | { |
| 261 | nano_time_t time; |
| 262 | cl_event event; |
| 263 | cl_int status; |
| 264 | cl_command_queue queue = base_->commandQueues()[0]; |
| 265 | |
| 266 | status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0, |
| 267 | params_.rowsC * params_.columnsC * |
| 268 | sizeof(ElemType), backC_, 0, NULL, &event); |
| 269 | if (status != CL_SUCCESS) { |
| 270 | cerr << "Vector Y buffer object enqueuing error, status = " << |
| 271 | status << endl; |
| 272 | |
| 273 | return NANOTIME_ERR; |
| 274 | } |
| 275 | |
| 276 | status = clWaitForEvents(1, &event); |
| 277 | if (status != CL_SUCCESS) { |
| 278 | cout << "Wait on event failed, status = " << |
| 279 | status << endl; |
| 280 | |
| 281 | return NANOTIME_ERR; |
| 282 | } |
| 283 | |
| 284 | event = NULL; |
| 285 | |
| 286 | //#define TIMING |
| 287 | #ifdef TIMING |
| 288 | clFinish( queue); |
| 289 | |
| 290 | time = getCurrentTime(); |
| 291 | int iter = 20; |
| 292 | for ( int i = 1; i <= iter; i++) |
| 293 | { |
| 294 | #endif |
| 295 | status = (cl_int)clMath::clblas::symv(params_.order, |
| 296 | params_.uplo, params_.N, alpha_, mobjA_, params_.offA, params_.lda, |
| 297 | mobjB_, params_.offBX, params_.incx, |
| 298 | beta_, mobjC_, params_.offCY, params_.incy, |
| 299 | 1, &queue, 0, NULL, &event); |
| 300 | if (status != CL_SUCCESS) { |
| 301 | cerr << "The CLBLAS SYMV 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; |
nothing calls this directly
no test coverage detected