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

Method clblasPerfSingle

src/tests/performance/perf-gerc.cpp:293–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291
292
293template <typename ElemType> nano_time_t
294GercPerformanceTest<ElemType>::clblasPerfSingle(void)
295{
296 nano_time_t time;
297 cl_event event;
298 cl_int status;
299 cl_command_queue queue = base_->commandQueues()[0];
300
301 status = clEnqueueWriteBuffer(queue, mobjA_, CL_TRUE, 0,
302 (lengthA + params_.offa) * sizeof(ElemType), backA_, 0, NULL, &event);
303 if (status != CL_SUCCESS) {
304 cerr << "Matrix A buffer object enqueuing error, status = " <<
305 status << endl;
306
307 return NANOTIME_ERR;
308 }
309
310 status = clWaitForEvents(1, &event);
311 if (status != CL_SUCCESS) {
312 cout << "Wait on event failed, status = " <<
313 status << endl;
314
315 return NANOTIME_ERR;
316 }
317
318 event = NULL;
319 time = getCurrentTime();
320
321#define TIMING
322#ifdef TIMING
323 clFinish( queue);
324
325 int iter = 20;
326 for ( int i = 1; i <= iter; i++)
327 {
328#endif
329
330 status = (cl_int)clMath::clblas::gerc(params_.order, params_.M, params_.N, alpha_,
331 mobjx_, params_.offBX, params_.incx, mobjy_, params_.offCY, params_.incy, mobjA_, params_.offa, params_.lda, 1,
332 &queue, 0, NULL, &event);
333 if (status != CL_SUCCESS) {
334 cerr << "The CLBLAS GERC function failed, status = " <<
335 status << endl;
336
337 return NANOTIME_ERR;
338 }
339#ifdef TIMING
340 } // iter loop
341 clFinish( queue);
342 time = getCurrentTime() - time;
343 time /= iter;
344#else
345
346 status = flushAll(1, &queue);
347 if (status != CL_SUCCESS) {
348 cerr << "clFlush() failed, status = " << status << endl;
349 return NANOTIME_ERR;
350 }

Callers

nothing calls this directly

Calls 4

commandQueuesMethod · 0.80
getCurrentTimeFunction · 0.50
flushAllFunction · 0.50
waitForSuccessfulFinishFunction · 0.50

Tested by

no test coverage detected