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

Method clblasPerfSingle

src/tests/performance/perf-trsv.cpp:241–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240
241template <typename ElemType> nano_time_t
242TrsvPerformanceTest<ElemType>::clblasPerfSingle(void)
243{
244 nano_time_t time;
245 cl_event event;
246 cl_int status;
247 cl_command_queue queue = base_->commandQueues()[0];
248 size_t lenX = 1 + ((params_.N-1) * abs(params_.incx)) + params_.offBX;
249
250 status = clEnqueueWriteBuffer(queue, mobjX_, CL_TRUE, 0,
251 lenX * sizeof(ElemType), backX_, 0, NULL, &event);
252 if (status != CL_SUCCESS) {
253 cerr << "Vector X buffer object enqueuing error, status = " <<
254 status << endl;
255
256 return NANOTIME_ERR;
257 }
258
259 status = clWaitForEvents(1, &event);
260 if (status != CL_SUCCESS) {
261 cout << "Wait on event failed, status = " <<
262 status << endl;
263
264 return NANOTIME_ERR;
265 }
266
267 event = NULL;
268
269 DataType type;
270 type = ( typeid(ElemType) == typeid(float))? TYPE_FLOAT:( typeid(ElemType) == typeid(double))? TYPE_DOUBLE: ( typeid(ElemType) == typeid(FloatComplex))? TYPE_COMPLEX_FLOAT: TYPE_COMPLEX_DOUBLE;
271
272 time = getCurrentTime();
273#define TIMING
274#ifdef TIMING
275 clFinish( queue);
276
277 int iter = 20;
278 for ( int i = 1; i <= iter; i++)
279 {
280#endif
281 status = (cl_int)clMath::clblas::trsv(type, params_.order, params_.uplo,
282 params_.transA, params_.diag, params_.N, mobjA_, params_.offa, params_.lda,
283 mobjX_, params_.offBX, params_.incx, 1, &queue, 0, NULL, &event);
284
285 if (status != CL_SUCCESS) {
286 cerr << "The CLBLAS TRSV function failed, status = " <<
287 status << endl;
288
289 return NANOTIME_ERR;
290 }
291
292#ifdef TIMING
293 } // iter loop
294 clFinish( queue);
295 time = getCurrentTime() - time;
296 time /= iter;
297#else
298

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