Initial support for non-uniform NDRanges (#572)
This implementation uses the approach outlined in #522 and push constants
for all the values that need to be communicated by the application/runtime.
The push constant space required is quite large in the worst case (which is
unlikely to be a common occurrence in typical code). There are definitely
applications where using specialisation constants everywhere would result
in a ridiculous amount of recompilation and likely others where saving some
push constant space would be a win (especially once POD arguments will
use push constants).
The CTS tests require that reqd_work_group_size be treated not as a hard
requirement but more as an upper bound/hint which seems odd. I've created
https://github.com/KhronosGroup/OpenCL-Docs/issues/267 to discuss this.
This change satisfies the CTS and is good enough to pass the entire
non_uniform_work_group CTS suite with the appropriate clvk changes.
Fixes #522.
Signed-off-by: Kévin Petit <kpet@free.fr>
diff --git a/lib/PushConstant.cpp b/lib/PushConstant.cpp
index 32c931d..2426ae3 100644
--- a/lib/PushConstant.cpp
+++ b/lib/PushConstant.cpp
@@ -36,6 +36,14 @@
return "global_offset";
case PushConstant::EnqueuedLocalSize:
return "enqueued_local_size";
+ case PushConstant::GlobalSize:
+ return "global_size";
+ case PushConstant::RegionOffset:
+ return "region_offset";
+ case PushConstant::NumWorkgroups:
+ return "num_workgroups";
+ case PushConstant::RegionGroupOffset:
+ return "region_group_offset";
}
llvm_unreachable("Unknown PushConstant in GetPushConstantName");
return "";
@@ -50,6 +58,14 @@
return VectorType::get(IntegerType::get(C, 32), 3);
case PushConstant::EnqueuedLocalSize:
return VectorType::get(IntegerType::get(C, 32), 3);
+ case PushConstant::GlobalSize:
+ return VectorType::get(IntegerType::get(C, 32), 3);
+ case PushConstant::RegionOffset:
+ return VectorType::get(IntegerType::get(C, 32), 3);
+ case PushConstant::NumWorkgroups:
+ return VectorType::get(IntegerType::get(C, 32), 3);
+ case PushConstant::RegionGroupOffset:
+ return VectorType::get(IntegerType::get(C, 32), 3);
}
llvm_unreachable("Unknown PushConstant in GetPushConstantType");
return nullptr;