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