summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorcnugteren <web@cedricnugteren.nl>2016-04-09 22:22:24 -0600
committercnugteren <web@cedricnugteren.nl>2016-04-09 22:22:24 -0600
commit1d3d38a2618c5663bf1549b08805137fd85f2efa (patch)
tree5de200346fc3d87c6e353d84744c59b2c703c16d /samples
parentc2cfee76c4d8f7486d5b62b3e0a878867a32a070 (diff)
Events are now properly implemented using event waiting list and asking the user to wait for event completion
Diffstat (limited to 'samples')
-rw-r--r--samples/sgemm.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/samples/sgemm.cc b/samples/sgemm.cc
index 785b051c..78f2dee8 100644
--- a/samples/sgemm.cc
+++ b/samples/sgemm.cc
@@ -61,7 +61,7 @@ int main() {
// Creates the OpenCL context, queue, and an event
auto context = cl::Context({device});
auto queue = cl::CommandQueue(context, device);
- auto event = cl::Event();
+ auto event = cl_event{nullptr};
// Populate host matrices with some example data
auto host_a = std::vector<float>(m*k);
@@ -84,7 +84,6 @@ int main() {
// Call the SGEMM routine. Note that the type of alpha and beta (float) determine the precision.
auto queue_plain = queue();
- auto event_plain = event();
auto status = Gemm(clblast::Layout::kRowMajor,
clblast::Transpose::kNo, clblast::Transpose::kNo,
m, n, k,
@@ -93,10 +92,10 @@ int main() {
device_b(), 0, b_ld,
beta,
device_c(), 0, c_ld,
- &queue_plain, &event_plain);
+ &queue_plain, &event);
// Record the execution time
- event.wait();
+ clWaitForEvents(1, &event);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
auto time_ms = std::chrono::duration<double,std::milli>(elapsed_time).count();