Skip to content

Commit

Permalink
command_buffer_event_sync.cpp: add delay for testing clSetEventCallback
Browse files Browse the repository at this point in the history
according to specification, these can be executed asynchronously
by the OpenCL runtime.
  • Loading branch information
franz committed Aug 29, 2024
1 parent 7bdb11e commit 32872d5
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "procs.h"

#include <vector>
#include <thread>
#include <chrono>

//--------------------------------------------------------------------------
enum class EventMode
Expand Down Expand Up @@ -416,6 +418,11 @@ struct CommandBufferEventSync : public BasicCommandBufferTest
error = clFinish(queue);
test_error(error, "clFinish failed");

for (unsigned i = 0; i < 30; ++i) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
if (confirmation) break;
}

// verify the result
if (!confirmation)
{
Expand Down Expand Up @@ -763,6 +770,11 @@ struct CommandBufferEventSync : public BasicCommandBufferTest
error = clFinish(queue);
test_error(error, "clFinish failed");

for (unsigned i = 0; i < 30; ++i) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
if (confirmation) break;
}

// verify the result
if (!confirmation)
{
Expand Down

0 comments on commit 32872d5

Please sign in to comment.