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

Method clblasPerfSingle

src/tests/performance/perf-rotg.cpp:289–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287
288
289template <typename ElemType1, typename ElemType2> nano_time_t
290RotgPerformanceTest<ElemType1, ElemType2>::clblasPerfSingle(void)
291{
292 nano_time_t time;
293 cl_event event;
294 cl_int status;
295 cl_command_queue queue = base_->commandQueues()[0];
296
297 DataType type;
298 type = ( typeid(ElemType1) == typeid(float))? TYPE_FLOAT:( typeid(ElemType1) == typeid(double))? TYPE_DOUBLE:
299 ( typeid(ElemType1) == typeid(FloatComplex))? TYPE_COMPLEX_FLOAT: TYPE_COMPLEX_DOUBLE;
300
301 status = clEnqueueWriteBuffer(queue, mobjSA_, CL_TRUE, 0, (1 + params_.offBX) * sizeof(ElemType1), SA_, 0, NULL, &event);
302 if (status != CL_SUCCESS)
303 {
304 cerr << "Vector SA buffer object enqueuing error, status = " << status << endl;
305 return NANOTIME_ERR;
306 }
307
308 status = clEnqueueWriteBuffer(queue, mobjSB_, CL_TRUE, 0, (1 + params_.offCY) * sizeof(ElemType1), SB_, 0, NULL, &event);
309 if (status != CL_SUCCESS)
310 {
311 cerr << "Vector SB buffer object enqueuing error, status = " << status << endl;
312 return NANOTIME_ERR;
313 }
314
315 status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0, (1 + params_.offa) * sizeof(ElemType2), C_, 0, NULL, &event);
316 if (status != CL_SUCCESS)
317 {
318 cerr << "Vector C buffer object enqueuing error, status = " << status << endl;
319 return NANOTIME_ERR;
320 }
321
322 status = clEnqueueWriteBuffer(queue, mobjS_, CL_TRUE, 0, (1 + params_.offb) * sizeof(ElemType1), S_, 0, NULL, &event);
323 if (status != CL_SUCCESS)
324 {
325 cerr << "Vector S buffer object enqueuing error, status = " << status << endl;
326 return NANOTIME_ERR;
327 }
328
329 status = clWaitForEvents(1, &event);
330 if (status != CL_SUCCESS)
331 {
332 cout << "Wait on event failed, status = " << status << endl;
333 return NANOTIME_ERR;
334 }
335
336 event = NULL;
337 time = getCurrentTime();
338
339#define TIMING
340#ifdef TIMING
341 clFinish( queue);
342 int iter = 50;
343 for ( int i=1; i <= iter; i++)
344 {
345#endif
346 status = (cl_int)clMath::clblas::rotg(type, mobjSA_, params_.offBX, mobjSB_, params_.offCY, mobjC_, params_.offa, mobjS_, params_.offb,

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