Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d70a59b

Browse filesBrowse files
committed
Limit the maximum kernel size to 5kb for OpenCL to manage compile times
1 parent de0aba4 commit d70a59b
Copy full SHA for d70a59b

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎src/backend/opencl/Array.cpp

Copy file name to clipboardExpand all lines: src/backend/opencl/Array.cpp
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,15 @@ kJITHeuristics passesJitHeuristics(span<Node *> root_nodes) {
334334
(3 * sizeof(uint));
335335

336336
const cl::Device &device = getDevice();
337-
size_t max_param_size = device.getInfo<CL_DEVICE_MAX_PARAMETER_SIZE>();
338337
// typical values:
339338
// NVIDIA = 4096
340339
// AMD = 3520 (AMD A10 iGPU = 1024)
341340
// Intel iGPU = 1024
341+
//
342+
// Setting the maximum to 5120 bytes to keep the compile times
343+
// resonable. This still results in large kernels but its not excessive.
344+
size_t max_param_size =
345+
min(5120UL, device.getInfo<CL_DEVICE_MAX_PARAMETER_SIZE>());
342346
max_param_size -= base_param_size;
343347

344348
struct tree_info {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.