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 9, 2024
1 parent a6a95ce commit 7a9a819
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 @@ -418,6 +420,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 @@ -765,6 +772,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 7a9a819

Please sign in to comment.