mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Array based clUpdateMutableCommandsKHR changes (#1984)
CTS changes to reflect the spec changes merged in https://github.com/KhronosGroup/OpenCL-Docs/pull/1045 and requires header updates from https://github.com/KhronosGroup/OpenCL-Headers/pull/245 Tested using OCK implementation from https://github.com/codeplaysoftware/oneapi-construction-kit/pull/501
This commit is contained in:
@@ -165,8 +165,6 @@ struct MutableDispatchGlobalArguments : public MutableDispatchArgumentsTest
|
||||
cl_mutable_dispatch_arg_khr arg{ 1, sizeof(dst_buf_1), &dst_buf_1 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -180,12 +178,13 @@ struct MutableDispatchGlobalArguments : public MutableDispatchArgumentsTest
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
@@ -292,8 +291,6 @@ struct MutableDispatchLocalArguments : public MutableDispatchArgumentsTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_1 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -306,15 +303,17 @@ struct MutableDispatchLocalArguments : public MutableDispatchArgumentsTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error = clFinish(queue);
|
||||
test_error(error, "clFinish failed.");
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error =
|
||||
@@ -426,8 +425,6 @@ struct MutableDispatchPODArguments : public MutableDispatchArgumentsTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_1 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -440,15 +437,17 @@ struct MutableDispatchPODArguments : public MutableDispatchArgumentsTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error = clFinish(queue);
|
||||
test_error(error, "clFinish failed.");
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueReadBuffer(queue, stream, CL_TRUE, 0, size_to_allocate,
|
||||
@@ -572,8 +571,6 @@ struct MutableDispatchNullArguments : public MutableDispatchArgumentsTest
|
||||
// Modify and execute the command buffer
|
||||
cl_mutable_dispatch_arg_khr arg{ 0, sizeof(cl_mem), nullptr };
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -587,12 +584,13 @@ struct MutableDispatchNullArguments : public MutableDispatchArgumentsTest
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
@@ -773,19 +771,18 @@ struct MutableDispatchSVMArguments : public MutableDispatchArgumentsTest
|
||||
exec_info.param_value = &new_buffer;
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{};
|
||||
dispatch_config.type = CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR;
|
||||
dispatch_config.command = command;
|
||||
dispatch_config.num_svm_args = 1;
|
||||
dispatch_config.arg_svm_list = &arg_svm;
|
||||
dispatch_config.num_exec_infos = 1;
|
||||
dispatch_config.exec_info_list = &exec_info;
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{};
|
||||
mutable_config.type = CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR;
|
||||
mutable_config.num_mutable_dispatch = 1;
|
||||
mutable_config.mutable_dispatch_list = &dispatch_config;
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
|
||||
@@ -80,6 +80,22 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
|
||||
"cl_khr_command_buffer_mutable_dispatch")
|
||||
== true;
|
||||
|
||||
if (extension_avaliable) {
|
||||
// API breaking changes occur at revision 0.9.2, check implementation
|
||||
// matches tested API
|
||||
Version device_version = get_device_cl_version(device);
|
||||
if ((device_version >= Version(3, 0))
|
||||
|| is_extension_available(device, "cl_khr_extended_versioning")) {
|
||||
|
||||
cl_version extension_version =
|
||||
get_extension_version(device, "cl_khr_command_buffer_mutable_dispatch");
|
||||
|
||||
if (extension_version < CL_MAKE_VERSION(0, 9, 2)) {
|
||||
extension_avaliable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cl_mutable_dispatch_fields_khr mutable_capabilities;
|
||||
|
||||
bool mutable_support =
|
||||
|
||||
@@ -69,7 +69,7 @@ struct MutableCommandFullDispatch : InfoMutableCommandBufferTest
|
||||
available_caps &= ~CL_MUTABLE_DISPATCH_EXEC_INFO_KHR;
|
||||
|
||||
// require at least one mutable capabillity
|
||||
return (available_caps == 0) && InfoMutableCommandBufferTest::Skip();
|
||||
return (available_caps == 0) || InfoMutableCommandBufferTest::Skip();
|
||||
}
|
||||
|
||||
// setup kernel program specific for command buffer with full mutable
|
||||
@@ -336,8 +336,6 @@ struct MutableCommandFullDispatch : InfoMutableCommandBufferTest
|
||||
|
||||
// Modify and execute the command buffer
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
0 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -395,12 +393,13 @@ struct MutableCommandFullDispatch : InfoMutableCommandBufferTest
|
||||
dispatch_config.local_work_size = &group_size;
|
||||
}
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
|
||||
@@ -88,8 +88,6 @@ struct MutableDispatchGlobalOffset : InfoMutableCommandBufferTest
|
||||
test_error(error, "clFinish failed.");
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
0 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -102,12 +100,14 @@ struct MutableDispatchGlobalOffset : InfoMutableCommandBufferTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
|
||||
@@ -87,8 +87,6 @@ struct MutableDispatchGlobalSize : public InfoMutableCommandBufferTest
|
||||
test_error(error, "clFinish failed.");
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
0 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -101,12 +99,14 @@ struct MutableDispatchGlobalSize : public InfoMutableCommandBufferTest
|
||||
&update_global_size /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
|
||||
@@ -162,8 +162,6 @@ struct MutableDispatchImage1DArguments : public BasicMutableCommandBufferTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_2 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -176,11 +174,14 @@ struct MutableDispatchImage1DArguments : public BasicMutableCommandBufferTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
@@ -360,8 +361,6 @@ struct MutableDispatchImage2DArguments : public BasicMutableCommandBufferTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_2 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -374,11 +373,14 @@ struct MutableDispatchImage2DArguments : public BasicMutableCommandBufferTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
|
||||
@@ -152,8 +152,6 @@ struct IterativeArgUpdateDispatch : BasicMutableCommandBufferTest
|
||||
cl_mutable_dispatch_arg_khr args = { 0, sizeof(cl_int), &pattern_sec };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -167,12 +165,13 @@ struct IterativeArgUpdateDispatch : BasicMutableCommandBufferTest
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
// update parameter of previous mutable dispatch by using the same
|
||||
@@ -181,7 +180,8 @@ struct IterativeArgUpdateDispatch : BasicMutableCommandBufferTest
|
||||
args.arg_size = sizeof(new_out_mem);
|
||||
args.arg_value = &new_out_mem;
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueFillBuffer(queue, new_out_mem, &pattern_pri,
|
||||
|
||||
@@ -90,8 +90,6 @@ struct MutableDispatchLocalSize : public InfoMutableCommandBufferTest
|
||||
test_error(error, "clFinish failed.");
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
0 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -104,12 +102,14 @@ struct MutableDispatchLocalSize : public InfoMutableCommandBufferTest
|
||||
&update_global_size /* global_work_size */,
|
||||
&update_local_size /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0,
|
||||
|
||||
@@ -164,20 +164,20 @@ struct MultipleCommandsDispatch : BasicMutableCommandBufferTest
|
||||
|
||||
// modify two mutable parameters, each one with separate handle
|
||||
cl_mutable_dispatch_config_khr dispatch_config[] = {
|
||||
{ CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, nullptr,
|
||||
command_pri, 1, 0, 0, 0, args_pri, nullptr, nullptr, nullptr,
|
||||
{ command_pri, 1, 0, 0, 0, args_pri, nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr },
|
||||
{ CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, nullptr,
|
||||
command_sec, 1, 0, 0, 0, args_sec, nullptr, nullptr, nullptr,
|
||||
{ command_sec, 1, 0, 0, 0, args_sec, nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr },
|
||||
};
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 2,
|
||||
dispatch_config
|
||||
cl_uint num_configs = 2;
|
||||
cl_command_buffer_update_type_khr config_types[2] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[2] = { &dispatch_config[0], &dispatch_config[1] };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
// repeat execution of modified command buffer
|
||||
|
||||
@@ -157,8 +157,6 @@ struct OverwriteUpdateDispatch : BasicMutableCommandBufferTest
|
||||
&unused_mem } };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
2 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -172,19 +170,21 @@ struct OverwriteUpdateDispatch : BasicMutableCommandBufferTest
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
// overwrite previous update of mutable arguments
|
||||
args[0].arg_value = &pattern_sec;
|
||||
args[1].arg_value = &new_out_mem;
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueFillBuffer(queue, new_out_mem, &pattern_pri,
|
||||
|
||||
@@ -224,8 +224,6 @@ struct SimultaneousMutableDispatchTest : public BasicMutableCommandBufferTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_1 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -238,13 +236,14 @@ struct SimultaneousMutableDispatchTest : public BasicMutableCommandBufferTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error =
|
||||
clUpdateMutableCommandsKHR(work_command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void* configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
error = clEnqueueCommandBufferKHR(0, nullptr, work_command_buffer, 0,
|
||||
@@ -343,8 +342,6 @@ struct SimultaneousMutableDispatchTest : public BasicMutableCommandBufferTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_1 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
1 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -357,13 +354,14 @@ struct SimultaneousMutableDispatchTest : public BasicMutableCommandBufferTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error =
|
||||
clUpdateMutableCommandsKHR(work_command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void* configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
// command buffer execution must wait for two wait-events
|
||||
@@ -552,8 +550,6 @@ struct CrossQueueSimultaneousMutableDispatchTest
|
||||
cl_mutable_dispatch_arg_khr args[] = { arg_0, arg_1 };
|
||||
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
2 /* num_args */,
|
||||
0 /* num_svm_arg */,
|
||||
@@ -566,12 +562,14 @@ struct CrossQueueSimultaneousMutableDispatchTest
|
||||
nullptr /* global_work_size */,
|
||||
nullptr /* local_work_size */
|
||||
};
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
};
|
||||
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config);
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
const void* configs[1] = { &dispatch_config };
|
||||
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
// enqueue command buffer to non-default queue
|
||||
|
||||
@@ -199,8 +199,6 @@ struct MutableDispatchWorkGroups : public BasicMutableCommandBufferTest
|
||||
{
|
||||
cl_int error;
|
||||
cl_mutable_dispatch_config_khr dispatch_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR,
|
||||
nullptr,
|
||||
command,
|
||||
0, // num_args
|
||||
0, // num_svm_arg
|
||||
@@ -214,13 +212,14 @@ struct MutableDispatchWorkGroups : public BasicMutableCommandBufferTest
|
||||
nullptr // local_work_size
|
||||
};
|
||||
|
||||
cl_mutable_base_config_khr mutable_config{
|
||||
CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR, nullptr, 1,
|
||||
&dispatch_config
|
||||
cl_uint num_configs = 1;
|
||||
cl_command_buffer_update_type_khr config_types[1] = {
|
||||
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR
|
||||
};
|
||||
|
||||
const void *configs[1] = { &dispatch_config };
|
||||
error =
|
||||
clUpdateMutableCommandsKHR(single_command_buffer, &mutable_config);
|
||||
clUpdateMutableCommandsKHR(single_command_buffer, num_configs,
|
||||
config_types, configs);
|
||||
test_error(error, "clUpdateMutableCommandsKHR failed");
|
||||
|
||||
clEventWrapper events[2];
|
||||
|
||||
Reference in New Issue
Block a user