MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / clblasPerfSingle

Method clblasPerfSingle

src/tests/performance/perf-sbmv.cpp:259–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258
259template <typename ElemType> nano_time_t
260SbmvPerformanceTest<ElemType>::clblasPerfSingle(void)
261{
262 nano_time_t time;
263 cl_event event;
264 cl_int status;
265 size_t lenY;
266 cl_command_queue queue = base_->commandQueues()[0];
267
268 lenY = (params_.N - 1)* params_.incy + 1 + params_.offCY;
269
270 status = clEnqueueWriteBuffer(queue, mobjY_, CL_TRUE, 0,
271 lenY * sizeof(ElemType), backY_, 0, NULL, &event);
272
273 if (status != CL_SUCCESS) {
274 cerr << "Vector Y buffer object enqueuing error, status = " <<
275 status << endl;
276
277 return NANOTIME_ERR;
278 }
279
280 status = clWaitForEvents(1, &event);
281 if (status != CL_SUCCESS) {
282 cout << "Wait on event failed, status = " <<
283 status << endl;
284
285 return NANOTIME_ERR;
286 }
287
288 event = NULL;
289 time = getCurrentTime();
290 int iter = 20;
291 for ( int i = 1; i <= iter; i++)
292 {
293 status = clMath::clblas::sbmv(params_.order, params_.uplo, params_.N, params_.K,
294 alpha, mobjA_, params_.offA, params_.lda, mobjX_, params_.offBX, params_.incx,
295 beta, mobjY_, params_.offCY, params_.incy, 1, &queue, 0, NULL, &event);
296
297 if (status != CL_SUCCESS) {
298 cerr << "The CLBLAS GBMV function failed, status = " <<
299 status << endl;
300 return NANOTIME_ERR;
301 }
302 }
303 clFinish( queue );
304 time = getCurrentTime() - time;
305 time /= iter;
306
307 return time;
308}
309
310} // namespace clMath
311

Callers

nothing calls this directly

Calls 2

commandQueuesMethod · 0.80
getCurrentTimeFunction · 0.50

Tested by

no test coverage detected