From c8cf71f1a046b4758e20d6398a654777c3fb5193 Mon Sep 17 00:00:00 2001 From: Alexandru Dutu Date: Tue, 4 Oct 2016 13:03:52 -0400 Subject: gpu-compute: Added method to compute the actual workgroup size This patch adds a method to the Wavefront class to compute the actual workgroup size. This can be different from the maximum workgroup size specified when launching the kernel through the NDRange object. Current solution is still not optimal, as we are computing these for each wavefront and the dispatcher also needs to have this information and can't actually call Wavefront::computeActuallWgSz before the wavefronts are being created. A long term solution would be to have a Workgroup class that deals with all these details. --- src/gpu-compute/wavefront.hh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gpu-compute/wavefront.hh') diff --git a/src/gpu-compute/wavefront.hh b/src/gpu-compute/wavefront.hh index ef8c80989..0df8a6c82 100644 --- a/src/gpu-compute/wavefront.hh +++ b/src/gpu-compute/wavefront.hh @@ -47,6 +47,7 @@ #include "gpu-compute/condition_register_state.hh" #include "gpu-compute/lds_state.hh" #include "gpu-compute/misc.hh" +#include "gpu-compute/ndrange.hh" #include "params/Wavefront.hh" #include "sim/sim_object.hh" @@ -189,11 +190,16 @@ class Wavefront : public SimObject std::vector lastAddr; std::vector workItemId[3]; std::vector workItemFlatId; + /* kernel launch parameters */ uint32_t workGroupId[3]; uint32_t workGroupSz[3]; uint32_t gridSz[3]; uint32_t wgId; uint32_t wgSz; + /* the actual WG size can differ than the maximum size */ + uint32_t actualWgSz[3]; + uint32_t actualWgSzTotal; + void computeActualWgSz(NDRange *ndr); // wavefront id within a workgroup uint32_t wfId; uint32_t maxDynWaveId; -- cgit v1.2.3