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