Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(${MODULE_NAME}_SOURCES
command_buffer_test_barrier.cpp
command_buffer_test_event_info.cpp
command_buffer_finalize.cpp
command_buffer_pipelined_enqueue.cpp
negative_command_buffer_finalize.cpp
negative_command_buffer_svm_mem.cpp
negative_command_buffer_copy_image.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ BasicCommandBufferTest::BasicCommandBufferTest(cl_device_id device,
: CommandBufferTestBase(device), context(context), queue(nullptr),
num_elements(0), simultaneous_use_support(false),
out_of_order_support(false), queue_out_of_order_support(false),
// try to use simultaneous path by default
simultaneous_use_requested(true),
// due to simultaneous cases extend buffer size
buffer_size_multiplier(1), command_buffer(this)
{
cl_int error = clRetainCommandQueue(queue);
Expand Down Expand Up @@ -72,9 +69,8 @@ bool BasicCommandBufferTest::Skip()
sizeof(capabilities), &capabilities, NULL);
test_error(error,
"Unable to query CL_DEVICE_COMMAND_BUFFER_CAPABILITIES_KHR");
simultaneous_use_support = simultaneous_use_requested
&& (capabilities & CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR)
!= 0;
simultaneous_use_support =
(capabilities & CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR) != 0;
out_of_order_support =
supported_properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
device_side_enqueue_support =
Expand Down Expand Up @@ -167,19 +163,7 @@ cl_int BasicCommandBufferTest::SetUp(int elements)
error = SetUpKernelArgs();
test_error(error, "SetUpKernelArgs failed");

if (simultaneous_use_support)
{
cl_command_buffer_properties_khr properties[3] = {
CL_COMMAND_BUFFER_FLAGS_KHR, CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR,
0
};
command_buffer =
clCreateCommandBufferKHR(1, &queue, properties, &error);
}
else
{
command_buffer = clCreateCommandBufferKHR(1, &queue, nullptr, &error);
}
command_buffer = clCreateCommandBufferKHR(1, &queue, nullptr, &error);
test_error(error, "clCreateCommandBufferKHR failed");

return CL_SUCCESS;
Expand All @@ -192,11 +176,6 @@ cl_int MultiFlagCreationTest::Run()

// First try to find multiple flags that are supported by the driver and
// device.
if (simultaneous_use_support)
{
flags |= CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR;
}

if (is_extension_available(
device, CL_KHR_COMMAND_BUFFER_MULTI_DEVICE_EXTENSION_NAME))
{
Expand All @@ -207,6 +186,11 @@ cl_int MultiFlagCreationTest::Run()
device, CL_KHR_COMMAND_BUFFER_MUTABLE_DISPATCH_EXTENSION_NAME))
{
flags |= CL_COMMAND_BUFFER_MUTABLE_KHR;

if (simultaneous_use_support)
{
flags |= CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR;
}
}

cl_command_buffer_properties_khr props[] = { CL_COMMAND_BUFFER_FLAGS_KHR,
Expand Down Expand Up @@ -381,11 +365,6 @@ cl_int ExplicitFlushTest::Run()
return CL_SUCCESS;
}

bool ExplicitFlushTest::Skip()
{
return BasicCommandBufferTest::Skip() || !simultaneous_use_support;
}

cl_int InterleavedEnqueueTest::Run()
{
cl_int error = clCommandNDRangeKernelKHR(
Expand Down Expand Up @@ -431,11 +410,6 @@ cl_int InterleavedEnqueueTest::Run()
return CL_SUCCESS;
}

bool InterleavedEnqueueTest::Skip()
{
return BasicCommandBufferTest::Skip() || !simultaneous_use_support;
}

cl_int EnqueueAndReleaseTest::Run()
{
cl_int error = clCommandNDRangeKernelKHR(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ struct BasicCommandBufferTest : CommandBufferTestBase
bool queue_out_of_order_support;
bool device_side_enqueue_support;

// user request for simultaneous use
bool simultaneous_use_requested;
// Extends size of created 'in_mem' & 'out_mem' buffers, such that the same
// cl_mem buffer can be used across multiple enqueues of a command-buffer.
// Accessed in the kernel at an offset for each enqueue which is passed as
// a kernel parameter through the 'off_mem' buffer.
// See BasicCommandBufferTest::SetUpKernel() definition.
unsigned buffer_size_multiplier;
clCommandBufferWrapper command_buffer;
};
Expand Down Expand Up @@ -116,7 +119,6 @@ struct ExplicitFlushTest : public BasicCommandBufferTest
using BasicCommandBufferTest::BasicCommandBufferTest;

cl_int Run() override;
bool Skip() override;
};

// Test enqueueing a command-buffer twice separated by another enqueue operation
Expand All @@ -125,7 +127,6 @@ struct InterleavedEnqueueTest : public BasicCommandBufferTest
using BasicCommandBufferTest::BasicCommandBufferTest;

cl_int Run() override;
bool Skip() override;
};

// Test releasing a command-buffer after it has been submitted for execution,
Expand Down Expand Up @@ -156,9 +157,9 @@ int MakeAndRunTest(cl_device_id device, cl_context context,
cl_version extension_version =
get_extension_version(device, "cl_khr_command_buffer");

if (extension_version != CL_MAKE_VERSION(0, 9, 7))
if (extension_version != CL_MAKE_VERSION(0, 9, 8))
{
log_info("cl_khr_command_buffer version 0.9.7 is required to run "
log_info("cl_khr_command_buffer version 0.9.8 is required to run "
"the test, skipping.\n ");
return TEST_SKIPPED_ITSELF;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest

virtual cl_int SetUp(int elements) override
{
BasicCommandBufferTest::SetUp(elements);
cl_int error = BasicCommandBufferTest::SetUp(elements);
test_error(error, "BasicCommandBufferTest::SetUp failed");

cl_int error = init_extension_functions();
error = init_extension_functions();
test_error(error, "Unable to initialise extension functions");

cl_command_buffer_properties_khr prop = CL_COMMAND_BUFFER_MUTABLE_KHR;
if (simultaneous_use_support)
if (simultaneous_use_requested)
{
prop |= CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR;
}
Expand Down Expand Up @@ -90,10 +91,10 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
cl_version extension_version = get_extension_version(
device, "cl_khr_command_buffer_mutable_dispatch");

if (extension_version != CL_MAKE_VERSION(0, 9, 3))
if (extension_version != CL_MAKE_VERSION(0, 9, 4))
{
log_info("cl_khr_command_buffer_mutable_dispatch version "
"0.9.3 is "
"0.9.4 is "
"required to run the test, skipping.\n ");
extension_avaliable = false;
}
Expand Down Expand Up @@ -128,6 +129,7 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
}

clUpdateMutableCommandsKHR_fn clUpdateMutableCommandsKHR = nullptr;
bool simultaneous_use_requested = false;

const char* kernelString = "__kernel void empty() {}";
const size_t global_work_size = 4 * 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ struct IterativeArgUpdateDispatch : BasicMutableCommandBufferTest
cl_command_queue queue)
: BasicMutableCommandBufferTest(device, context, queue),
command(nullptr)
{
simultaneous_use_requested = false;
}
{}

bool Skip() override
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ struct MultipleCommandsDispatch : BasicMutableCommandBufferTest
cl_command_queue queue)
: BasicMutableCommandBufferTest(device, context, queue),
command_pri(nullptr), command_sec(nullptr)
{
simultaneous_use_requested = false;
}
{}

bool Skip() override
{
Expand All @@ -47,7 +45,7 @@ struct MultipleCommandsDispatch : BasicMutableCommandBufferTest
sizeof(mutable_capabilities), &mutable_capabilities, nullptr)
&& mutable_capabilities & CL_MUTABLE_DISPATCH_ARGUMENTS_KHR;

// require mutable arguments capabillity
// require mutable arguments capability
return !mutable_support;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ struct OverwriteUpdateDispatch : BasicMutableCommandBufferTest
cl_command_queue queue)
: BasicMutableCommandBufferTest(device, context, queue),
command(nullptr)
{
simultaneous_use_requested = false;
}
{}

bool Skip() override
{
Expand Down
Loading