Matthew Poremba has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/56367 )
Change subject: gpu-compute: Fix default MTYPE initialization
......................................................................
gpu-compute: Fix default MTYPE initialization
The default MTYPE initialization in the emulated GPU driver is currently
doing a bitwise AND on an input integer param with other integers
instead of using a bitmask. Change this to use bitset and test the bit
positions corresponding to the values in the MTYPE enum that were
previously being used as an operand for bitwise AND.
This was causing invalid slicc transitions in some benchmarks for
combinations of request type and mtype that are undefined.
Change-Id: I93fee0eae1fff7141cd14c239c16d1d69925d08d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56367
Reviewed-by: Matt Sinclair <[email protected]>
Maintainer: Matt Sinclair <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/gpu-compute/gpu_compute_driver.cc
M src/gpu-compute/gpu_compute_driver.hh
2 files changed, 31 insertions(+), 4 deletions(-)
Approvals:
Matt Sinclair: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/gpu-compute/gpu_compute_driver.cc
b/src/gpu-compute/gpu_compute_driver.cc
index d98f4c6..ca870aa 100644
--- a/src/gpu-compute/gpu_compute_driver.cc
+++ b/src/gpu-compute/gpu_compute_driver.cc
@@ -67,14 +67,18 @@
// Convert the 3 bit mtype specified in Shader.py to the proper type
// used for requests.
- if (MtypeFlags::SHARED & p.m_type)
+ std::bitset<MtypeFlags::NUM_MTYPE_BITS> mtype(p.m_type);
+ if (mtype.test(MtypeFlags::SHARED)) {
defaultMtype.set(Request::SHARED);
+ }
- if (MtypeFlags::READ_WRITE & p.m_type)
+ if (mtype.test(MtypeFlags::READ_WRITE)) {
defaultMtype.set(Request::READ_WRITE);
+ }
- if (MtypeFlags::CACHED & p.m_type)
+ if (mtype.test(MtypeFlags::CACHED)) {
defaultMtype.set(Request::CACHED);
+ }
}
const char*
diff --git a/src/gpu-compute/gpu_compute_driver.hh
b/src/gpu-compute/gpu_compute_driver.hh
index 868ad1c..def40f4 100644
--- a/src/gpu-compute/gpu_compute_driver.hh
+++ b/src/gpu-compute/gpu_compute_driver.hh
@@ -168,7 +168,8 @@
{
SHARED = 0,
READ_WRITE = 1,
- CACHED = 2
+ CACHED = 2,
+ NUM_MTYPE_BITS
};
Request::CacheCoherenceFlags defaultMtype;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56367
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I93fee0eae1fff7141cd14c239c16d1d69925d08d
Gerrit-Change-Number: 56367
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <[email protected]>
Gerrit-Reviewer: Kyle Roarty <[email protected]>
Gerrit-Reviewer: Matt Sinclair <[email protected]>
Gerrit-Reviewer: Matthew Poremba <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s