summaryrefslogtreecommitdiff
path: root/src/gpu-compute/misc.hh
diff options
context:
space:
mode:
authorjkalamat <john.kalamatianos@amd.com>2016-06-09 11:24:55 -0400
committerjkalamat <john.kalamatianos@amd.com>2016-06-09 11:24:55 -0400
commit3724fb15faafaaca54cc7a500df9c1490a387049 (patch)
treebbd671b68ba971087a1cd45b208947c09a622d38 /src/gpu-compute/misc.hh
parente5b7b6780f9748b6f13ef91e3e22d53ebdf47968 (diff)
downloadgem5-3724fb15faafaaca54cc7a500df9c1490a387049.tar.xz
gpu-compute: parametrize Wavefront size
Eliminate the VSZ constant that defined the Wavefront size (in numbers of work items); replaced it with a parameter in the GPU.py configuration script. Changed all data structures dependent on the Wavefront size to be dynamically sized. Legal values of Wavefront size are 16, 32, 64 for now and checked at initialization time.
Diffstat (limited to 'src/gpu-compute/misc.hh')
-rw-r--r--src/gpu-compute/misc.hh18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/gpu-compute/misc.hh b/src/gpu-compute/misc.hh
index 4f8032832..5ade89789 100644
--- a/src/gpu-compute/misc.hh
+++ b/src/gpu-compute/misc.hh
@@ -37,28 +37,14 @@
#define __MISC_HH__
#include <bitset>
+#include <limits>
#include <memory>
#include "base/misc.hh"
class GPUDynInst;
-// wavefront size of the machine
-static const int VSZ = 64;
-
-/*
- This check is necessary because std::bitset only provides conversion to
- unsigned long or unsigned long long via to_ulong() or to_ullong(). there are
- a few places in the code where to_ullong() is used, however if VSZ is larger
- than a value the host can support then bitset will throw a runtime exception.
-
- we should remove all use of to_long() or to_ullong() so we can have VSZ
- greater than 64b, however until that is done this assert is required.
- */
-static_assert(VSZ <= sizeof(unsigned long long) * 8,
- "VSZ is larger than the host can support");
-
-typedef std::bitset<VSZ> VectorMask;
+typedef std::bitset<std::numeric_limits<unsigned long long>::digits> VectorMask;
typedef std::shared_ptr<GPUDynInst> GPUDynInstPtr;
class WaitClass