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

Method clblasPerfSingle

src/tests/performance/perf-hemm.cpp:281–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279
280
281template <typename ElemType> nano_time_t
282HemmPerformanceTest<ElemType>::clblasPerfSingle(void)
283{
284 nano_time_t time;
285 cl_event event;
286 cl_int status;
287 cl_command_queue queue = base_->commandQueues()[0];
288
289 status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0,
290 (params_.ldc * kbc + params_.offCY) * sizeof(ElemType), backC_, 0, NULL, &event);
291 if (status != CL_SUCCESS) {
292 cerr << "Matrix C buffer object enqueuing error, status = " <<
293 status << endl;
294
295 return NANOTIME_ERR;
296 }
297
298 status = clWaitForEvents(1, &event);
299 if (status != CL_SUCCESS) {
300 cout << "Wait on event failed, status = " <<
301 status << endl;
302
303 return NANOTIME_ERR;
304 }
305
306 event = NULL;
307
308 time = getCurrentTime();
309//#define TIMING
310#ifdef TIMING
311 clFinish( queue);
312
313 int iter = 20;
314 for ( int i = 1; i <= iter; i++)
315 {
316#endif
317 status = (cl_int)clMath::clblas::hemm(params_.order,
318 params_.side, params_.uplo, params_.M, params_.N, alpha_,
319 mobjA_, params_.offA, params_.lda, mobjB_, params_.offBX, params_.ldb, beta_, mobjC_, params_.offCY, params_.ldc, 1,
320 &queue, 0, NULL, &event);
321 if (status != CL_SUCCESS) {
322 cerr << "The CLBLAS HEMM function failed, status = " <<
323 status << endl;
324 return NANOTIME_ERR;
325 }
326#ifdef TIMING
327 } // iter loop
328 clFinish( queue);
329 time = getCurrentTime() - time;
330 time /= iter;
331#else
332
333 status = flushAll(1, &queue);
334 if (status != CL_SUCCESS) {
335 cerr << "clFlush() failed, status = " << status << endl;
336 return NANOTIME_ERR;
337 }
338

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