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 Sep 16, 2024
1 parent b1e0e7d commit c2d7032
Showing 1 changed file with 14 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,12 @@ 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 +771,12 @@ 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 c2d7032

Please sign in to comment.