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

Method clblasPerfSingle

src/tests/performance/perf-her.cpp:234–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234template <typename ElemType> nano_time_t
235HerPerformanceTest<ElemType>::clblasPerfSingle(void)
236{
237 nano_time_t time;
238 cl_event event;
239 cl_int status;
240 cl_command_queue queue = base_->commandQueues()[0];
241
242 status = clEnqueueWriteBuffer(queue, mobjA_, CL_TRUE, 0,
243 ((params_.N * params_.lda) + params_.offa) *
244 sizeof(ElemType), backA_, 0, NULL, &event);
245 if (status != CL_SUCCESS) {
246 cerr << "Matrix A buffer object enqueuing error, status = " <<
247 status << endl;
248
249 return NANOTIME_ERR;
250 }
251
252 status = clWaitForEvents(1, &event);
253 if (status != CL_SUCCESS) {
254 cout << "Wait on event failed, status = " <<
255 status << endl;
256
257 return NANOTIME_ERR;
258 }
259
260 event = NULL;
261
262#define TIMING
263#ifdef TIMING
264 clFinish( queue);
265 time = getCurrentTime();
266
267 int iter = 20;
268 for ( int i = 1; i <= iter; i++)
269 {
270#endif
271 status = (cl_int)clMath::clblas::her(params_.order, params_.uplo, params_.N, CREAL(alpha_), mobjX_, params_.offBX, params_.incx,
272 mobjA_, params_.offa, params_.lda, 1, &queue, 0, NULL, &event);
273
274 if (status != CL_SUCCESS) {
275 cerr << "The CLBLAS HER function failed, status = " <<
276 status << endl;
277
278 return NANOTIME_ERR;
279 }
280
281#ifdef TIMING
282 } // iter loop
283 clFinish( queue);
284 time = getCurrentTime() - time;
285 time /= iter;
286#else
287 status = flushAll(1, &queue);
288 if (status != CL_SUCCESS) {
289 cerr << "clFlush() failed, status = " << status << endl;
290 return NANOTIME_ERR;
291 }

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