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

Method clblasPerfSingle

src/tests/performance/perf-herk.cpp:251–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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