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

Method clblasPerfSingle

src/tests/performance/perf-hbmv.cpp:252–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

commandQueuesMethod · 0.80
getCurrentTimeFunction · 0.50

Tested by

no test coverage detected