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

Method eventInCorrectnessTest

src/tests/functional/func-event.cpp:100–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100template <typename T> void
101EventClass<T>::eventInCorrectnessTest()
102{
103 cl_int err;
104 cl_int ret = CL_SUCCESS;
105 int qmax = metod.qnum;
106 nano_time_t minSleepTime = 100000000;
107
108
109 if (generateData()) {
110
111 metod.outEvent = new cl_event[1];
112 metod.outEvent[0] = NULL;
113
114 nano_time_t timeFirst = getCurrentTime();
115 // First run.
116 err = metod.run();
117 ASSERT_EQ(err, CL_SUCCESS) << "clFinish()";
118 for (int i = 0; i < qmax; ++i) {
119 err = clFinish(metod.queues[i]);
120 }
121 ASSERT_EQ(err, CL_SUCCESS) << "clFinish()";
122 timeFirst = getCurrentTime() - timeFirst;
123
124 cl_event event = clCreateUserEvent(metod.context, &err);
125 ASSERT_EQ(err, CL_SUCCESS) << "clCreateUserEvent()";
126
127 metod.inEventCount = 1;
128 metod.inEvent = &event;
129
130 err = metod.run();
131 ASSERT_EQ(err, CL_SUCCESS) << "runClBlasFunction()";
132
133 clFlush(metod.queues[0]);
134
135 //
136 sleepTime((timeFirst < minSleepTime)? minSleepTime : timeFirst);
137
138 clSetUserEventStatus(event, CL_COMPLETE);
139
140 err = clFinish(metod.queues[0]);
141 err = clGetEventInfo(metod.outEvent[0], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &ret, NULL);
142 ASSERT_EQ(err, CL_SUCCESS) << "clGetEventInfo()";
143 ASSERT_EQ(ret, CL_COMPLETE) << "clGetEventInfo()";
144
145 clReleaseEvent(event);
146 metod.inEventCount = 0;
147 metod.inEvent = NULL;
148
149 }
150}
151#ifdef DO_THEIRS
152//******************************************************//
153TEST(EVENT_OUT, sgemm) {

Callers

nothing calls this directly

Calls 3

sleepTimeFunction · 0.85
getCurrentTimeFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected