summaryrefslogtreecommitdiff
path: root/src/gpu-compute/wavefront.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu-compute/wavefront.cc')
-rw-r--r--src/gpu-compute/wavefront.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gpu-compute/wavefront.cc b/src/gpu-compute/wavefront.cc
index 42739a7b0..c677cbe41 100644
--- a/src/gpu-compute/wavefront.cc
+++ b/src/gpu-compute/wavefront.cc
@@ -1066,3 +1066,14 @@ Wavefront::setContext(const void *in)
ldsChunk->write<char>(i, val);
}
}
+
+void
+Wavefront::computeActualWgSz(NDRange *ndr)
+{
+ actualWgSzTotal = 1;
+ for (int d = 0; d < 3; ++d) {
+ actualWgSz[d] = std::min(workGroupSz[d],
+ gridSz[d] - ndr->wgId[d] * workGroupSz[d]);
+ actualWgSzTotal *= actualWgSz[d];
+ }
+}