aboutsummaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpgpu-sim/shader.h')
-rw-r--r--src/gpgpu-sim/shader.h50
1 files changed, 14 insertions, 36 deletions
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 65d5625..deea1c9 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -1,6 +1,7 @@
// Copyright (c) 2009-2021, Tor M. Aamodt, Wilson W.L. Fung, Andrew Turner,
-// Ali Bakhoda, Vijay Kandiah, Nikos Hardavellas
-// The University of British Columbia, Northwestern University
+// Ali Bakhoda, Vijay Kandiah, Nikos Hardavellas,
+// Mahmoud Khairy, Junrui Pan, Timothy G. Rogers
+// The University of British Columbia, Northwestern University, Purdue University
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -170,6 +171,7 @@ class shd_warp_t {
void clear_membar() { m_membar = false; }
bool get_membar() const { return m_membar; }
virtual address_type get_pc() const { return m_next_pc; }
+ virtual kernel_info_t* get_kernel_info() const;
void set_next_pc(address_type pc) { m_next_pc = pc; }
void store_info_of_last_inst_at_barrier(const warp_inst_t *pI) {
@@ -954,41 +956,19 @@ class opndcoll_rfu_t { // operand collector based register file unit
void init(bool sub_core_model, unsigned num_warp_scheds) {
m_sub_core_model = sub_core_model;
m_num_warp_scheds = num_warp_scheds;
- if (m_sub_core_model) {
- m_last_cu_set = new unsigned(m_num_warp_scheds);
- for (unsigned i = 0; i < m_num_warp_scheds; i++)
- {
- m_last_cu_set[i] = i * m_num_collectors / m_num_warp_scheds;
- }
- }
-
}
collector_unit_t *find_ready() {
- if (m_sub_core_model) {
- assert(m_num_collectors % m_num_warp_scheds == 0 &&
- m_num_collectors >= m_num_warp_scheds);
- unsigned cusPerSched = m_num_collectors / m_num_warp_scheds;
- for (unsigned i = 0; i < m_num_warp_scheds; i++) {
- unsigned cuLowerBound = i * cusPerSched;
- unsigned cuUpperBound = cuLowerBound + cusPerSched;
- assert(0 <= cuLowerBound && cuUpperBound <= m_num_collectors);
- assert(cuLowerBound <= m_last_cu_set[i] && m_last_cu_set[i] <= cuUpperBound);
- for (unsigned j = cuLowerBound; j < cuUpperBound; j++) {
- unsigned c = cuLowerBound + (m_last_cu_set[i] + j + 1) % cusPerSched;
- if ((*m_collector_units)[c].ready()) {
- m_last_cu_set[i] = c;
- return &((*m_collector_units)[c]);
- }
- }
- }
- } else {
- for (unsigned n = 0; n < m_num_collectors; n++) {
- unsigned c = (m_last_cu + n + 1) % m_num_collectors;
- if ((*m_collector_units)[c].ready()) {
- m_last_cu = c;
- return &((*m_collector_units)[c]);
- }
+ // With sub-core enabled round robin starts with the next cu assigned to a
+ // different sub-core than the one that dispatched last
+ unsigned cusPerSched = m_num_collectors / m_num_warp_scheds;
+ unsigned rr_increment = m_sub_core_model ?
+ cusPerSched - (m_last_cu % cusPerSched) : 1;
+ for (unsigned n = 0; n < m_num_collectors; n++) {
+ unsigned c = (m_last_cu + n + rr_increment) % m_num_collectors;
+ if ((*m_collector_units)[c].ready()) {
+ m_last_cu = c;
+ return &((*m_collector_units)[c]);
}
}
return NULL;
@@ -998,9 +978,7 @@ class opndcoll_rfu_t { // operand collector based register file unit
unsigned m_num_collectors;
std::vector<collector_unit_t> *m_collector_units;
unsigned m_last_cu; // dispatch ready cu's rr
- unsigned *m_last_cu_set;
unsigned m_next_cu; // for initialization
-
bool m_sub_core_model;
unsigned m_num_warp_scheds;
};