Skip to content

Commit a2fc5d8

Browse files
committed
fix workgroup sizes in mutable_command_global_size test
test MutableDispatchGlobalSize was failing (with an implementation that doesn't support non-uniform WGs), because the update_global_size = 3 was not a multiple of the local work-size. Fixed by increasing the global work-size to 256K and update size to 16K. This should work with all devices that have max_work_group_size <= 16K. Updates also MutableDispatchWorkGroups which had an out-of-bounds access, because it hardcoded the value of global work-size.
1 parent 7484f2d commit a2fc5d8

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_basic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
126126
clUpdateMutableCommandsKHR_fn clUpdateMutableCommandsKHR = nullptr;
127127

128128
const char* kernelString = "__kernel void empty() {}";
129-
const size_t global_work_size = 4 * 16;
129+
const size_t global_work_size = 256 * 1024;
130130
};
131131

132132
struct InfoMutableCommandBufferTest : BasicMutableCommandBufferTest

test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_global_size.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ struct MutableDispatchGlobalSize : public InfoMutableCommandBufferTest
153153
}
154154

155155
size_t info_global_size = 0;
156-
const size_t update_global_size = 3;
157-
const size_t sizeToAllocate = global_work_size;
158-
const size_t num_elements = sizeToAllocate / sizeof(cl_int);
156+
const size_t update_global_size = 16 * 1024;
157+
const size_t sizeToAllocate = global_work_size * sizeof(cl_int);
158+
const size_t num_elements = global_work_size;
159159
cl_mutable_command_khr command = nullptr;
160160
};
161161

test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_work_groups.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,9 @@ struct MutableDispatchWorkGroups : public BasicMutableCommandBufferTest
278278
Configuration config;
279279

280280
size_t info_global_size = 0;
281-
static constexpr size_t test_global_work_size = 64;
282-
static constexpr size_t update_global_size = 16;
281+
static constexpr size_t update_global_size = 16 * 1024;
283282
const size_t local_work_size = 8;
284-
const size_t sizeToAllocate = 64 * sizeof(cl_int);
283+
const size_t sizeToAllocate = global_work_size * sizeof(cl_int);
285284
};
286285

287286
int test_command_buffer_with_no_additional_work_groups(cl_device_id device,

0 commit comments

Comments
 (0)