diff options
author | jkalamat <john.kalamatianos@amd.com> | 2016-06-09 11:24:55 -0400 |
---|---|---|
committer | jkalamat <john.kalamatianos@amd.com> | 2016-06-09 11:24:55 -0400 |
commit | 3724fb15faafaaca54cc7a500df9c1490a387049 (patch) | |
tree | bbd671b68ba971087a1cd45b208947c09a622d38 /src/gpu-compute/vector_register_state.cc | |
parent | e5b7b6780f9748b6f13ef91e3e22d53ebdf47968 (diff) | |
download | gem5-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/vector_register_state.cc')
-rw-r--r-- | src/gpu-compute/vector_register_state.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gpu-compute/vector_register_state.cc b/src/gpu-compute/vector_register_state.cc index f231b0579..e177d3b64 100644 --- a/src/gpu-compute/vector_register_state.cc +++ b/src/gpu-compute/vector_register_state.cc @@ -35,6 +35,8 @@ #include "gpu-compute/vector_register_state.hh" +#include <limits> + #include "gpu-compute/compute_unit.hh" VecRegisterState::VecRegisterState() : computeUnit(nullptr) @@ -51,8 +53,19 @@ VecRegisterState::setParent(ComputeUnit *_computeUnit) } void -VecRegisterState::init(uint32_t _size) +VecRegisterState::init(uint32_t _size, uint32_t wf_size) { s_reg.resize(_size); + fatal_if(wf_size > std::numeric_limits<unsigned long long>::digits || + wf_size <= 0, + "WF size is larger than the host can support or is zero"); + fatal_if((wf_size & (wf_size - 1)) != 0, + "Wavefront size should be a power of 2"); + for (int i = 0; i < s_reg.size(); ++i) { + s_reg[i].resize(wf_size, 0); + } d_reg.resize(_size); + for (int i = 0; i < d_reg.size(); ++i) { + d_reg[i].resize(wf_size, 0); + } } |