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

Method clblasPerfSingle

src/tests/performance/perf-her2k.cpp:260–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258
259
260template <typename ElemType> nano_time_t
261Her2kPerformanceTest<ElemType>::clblasPerfSingle(void)
262{
263 nano_time_t time;
264 cl_event event;
265 cl_int status;
266 cl_command_queue queue = base_->commandQueues()[0];
267
268 status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0,
269 params_.rowsC * params_.columnsC *
270 sizeof(ElemType), backC_, 0, NULL, &event);
271 if (status != CL_SUCCESS) {
272 cerr << "Matrix C buffer object enqueuing error, status = " <<
273 status << endl;
274
275 return NANOTIME_ERR;
276 }
277
278 status = clWaitForEvents(1, &event);
279 if (status != CL_SUCCESS) {
280 cout << "Wait on event failed, status = " <<
281 status << endl;
282
283 return NANOTIME_ERR;
284 }
285
286 event = NULL;
287
288 #define TIMING
289 #ifdef TIMING
290 clFinish( queue);
291 time = getCurrentTime();
292
293 int iter = 20;
294 for ( int i = 1; i <= iter; i++)
295 {
296 #endif
297
298 status = (cl_int)clMath::clblas::her2k(params_.order, params_.uplo, params_.transA, params_.N, params_.K, alpha_,
299 mobjA_, params_.offA, params_.lda, mobjB_, params_.offBX, params_.ldb, CREAL(beta_), mobjC_,
300 params_.offCY, params_.ldc, 1, &queue, 0, NULL, &event);
301 if (status != CL_SUCCESS) {
302 cerr << "The CLBLAS HER2K function failed, status = " <<
303 status << endl;
304
305 return NANOTIME_ERR;
306 }
307
308 #ifdef TIMING
309 } // iter loop
310 clFinish( queue);
311 time = getCurrentTime() - time;
312 time /= iter;
313 #else
314
315 status = flushAll(1, &queue);
316 if (status != CL_SUCCESS) {
317 cerr << "clFlush() failed, status = " << status << endl;

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