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

Method clblasPerfSingle

src/tests/performance/perf-symv.cpp:258–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected