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

Method clblasPerfSingle

src/tests/performance/perf-rotm.cpp:272–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271
272template <typename ElemType> nano_time_t
273RotmPerformanceTest<ElemType>::clblasPerfSingle(void)
274{
275 nano_time_t time;
276 cl_event event;
277 cl_int status;
278 cl_command_queue queue = base_->commandQueues()[0];
279
280 DataType type;
281 type = ( typeid(ElemType) == typeid(float))? TYPE_FLOAT: TYPE_DOUBLE;
282
283 status = clEnqueueWriteBuffer(queue, mobjX_, CL_TRUE, 0, (lengthx + params_.offa) * sizeof(ElemType), X_, 0, NULL, &event);
284 if (status != CL_SUCCESS)
285 {
286 cerr << "Vector X buffer object enqueuing error, status = " << status << endl;
287 return NANOTIME_ERR;
288 }
289
290 status = clEnqueueWriteBuffer(queue, mobjY_, CL_TRUE, 0, (lengthy + params_.offb) * sizeof(ElemType), Y_, 0, NULL, &event);
291 if (status != CL_SUCCESS)
292 {
293 cerr << "Vector Y buffer object enqueuing error, status = " << status << endl;
294 return NANOTIME_ERR;
295 }
296
297 status = clEnqueueWriteBuffer(queue, mobjParam_, CL_TRUE, 0, (5 + params_.offc) * sizeof(ElemType), PARAM_, 0, NULL, &event);
298 if (status != CL_SUCCESS)
299 {
300 cerr << "Vector C buffer object enqueuing error, status = " << status << endl;
301 return NANOTIME_ERR;
302 }
303
304 status = clWaitForEvents(1, &event);
305 if (status != CL_SUCCESS)
306 {
307 cout << "Wait on event failed, status = " << status << endl;
308 return NANOTIME_ERR;
309 }
310
311 event = NULL;
312 time = getCurrentTime();
313
314#define TIMING
315#ifdef TIMING
316 clFinish( queue);
317 int iter = 50;
318 for ( int i=1; i <= iter; i++)
319 {
320#endif
321 status = (cl_int)clMath::clblas::rotm(type, params_.N, mobjX_, params_.offa, params_.incx, mobjY_, params_.offb, params_.incy,
322 mobjParam_, params_.offc, 1, &queue, 0, NULL, &event);
323 if (status != CL_SUCCESS)
324 {
325 cerr << "The CLBLAS ROTM function failed, status = " << status << endl;
326 return NANOTIME_ERR;
327 }
328#ifdef TIMING
329 } // iter loop

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