Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
barnes88 committed Jun 7, 2024
1 parent 7dc9977 commit a2b0318
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/gpgpu-sim/shader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ void shader_core_ctx::issue_warp(register_set &pipe_reg_set,
// If the mask of the instruction is all 0, then the address is also 0,
// so that there's no need to check through the writeback
if (next_inst->get_active_mask() == 0) {
(m_warp[warp_id]->m_ldgdepbar_buf.back()).back().pc = -1;
(m_warp[warp_id]->m_ldgdepbar_buf.back()).back().pc = null_pc;
}
}

Expand All @@ -1087,9 +1087,9 @@ void shader_core_ctx::issue_warp(register_set &pipe_reg_set,
// Check for the case that the LDGSTSs monitored have finished when encountering the
// DEPBAR instruction
bool done_flag = true;
for (int i = 0; i < end_group; i++) {
for (int j = 0; j < m_warp[warp_id]->m_ldgdepbar_buf[i].size(); j++) {
if (m_warp[warp_id]->m_ldgdepbar_buf[i][j].pc != -1) {
for (unsigned i = 0; i < end_group; i++) {
for (unsigned j = 0; j < m_warp[warp_id]->m_ldgdepbar_buf[i].size(); j++) {
if (m_warp[warp_id]->m_ldgdepbar_buf[i][j].pc != null_pc) {
done_flag = false;
goto UpdateDEPBAR;
}
Expand Down Expand Up @@ -1853,22 +1853,22 @@ void shader_core_ctx::unset_depbar(const warp_inst_t &inst) {
(m_warp[inst.warp_id()]->m_depbar_start_id - m_warp[inst.warp_id()]->m_depbar_group + 1);

if (inst.m_is_ldgsts) {
for (int i = 0; i < m_warp[inst.warp_id()]->m_ldgdepbar_buf.size(); i++) {
for (int j = 0; j < m_warp[inst.warp_id()]->m_ldgdepbar_buf[i].size(); j++) {
for (unsigned i = 0; i < m_warp[inst.warp_id()]->m_ldgdepbar_buf.size(); i++) {
for (unsigned j = 0; j < m_warp[inst.warp_id()]->m_ldgdepbar_buf[i].size(); j++) {
if (m_warp[inst.warp_id()]->m_ldgdepbar_buf[i][j].pc == inst.pc) {
// Handle the case that same pc results in multiple LDGSTS instructions
if (m_warp[inst.warp_id()]->m_ldgdepbar_buf[i][j].get_addr(0) == inst.get_addr(0)) {
m_warp[inst.warp_id()]->m_ldgdepbar_buf[i][j].pc = -1;
m_warp[inst.warp_id()]->m_ldgdepbar_buf[i][j].pc = null_pc;
goto DoneWB;
}
}
}
}

DoneWB:
for (int i = 0; i < end_group; i++) {
for (int j = 0; j < m_warp[inst.warp_id()]->m_ldgdepbar_buf[i].size(); j++) {
if (m_warp[inst.warp_id()]->m_ldgdepbar_buf[i][j].pc != -1) {
for (unsigned i = 0; i < end_group; i++) {
for (unsigned j = 0; j < m_warp[inst.warp_id()]->m_ldgdepbar_buf[i].size(); j++) {
if (m_warp[inst.warp_id()]->m_ldgdepbar_buf[i][j].pc != null_pc) {
done_flag = false;
goto UpdateDEPBAR;
}
Expand Down
13 changes: 7 additions & 6 deletions src/gpgpu-sim/shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ class shd_warp_t {
m_waiting_ldgsts = false;

// Ni: Clear m_ldgdepbar_buf
for (int i = 0; i < m_ldgdepbar_buf.size(); i++) {
m_ldgdepbar_buf[i].clear();
}
for (auto b : m_ldgdepbar_buf) {
b.clear();
}
m_ldgdepbar_buf.clear();
}
void init(address_type start_pc, unsigned cta_id, unsigned wid,
Expand Down Expand Up @@ -164,9 +164,9 @@ class shd_warp_t {
m_waiting_ldgsts = false;

// Ni: Clear m_ldgdepbar_buf
for (int i = 0; i < m_ldgdepbar_buf.size(); i++) {
m_ldgdepbar_buf[i].clear();
}
for (auto b : m_ldgdepbar_buf) {
b.clear();
}
m_ldgdepbar_buf.clear();
}

Expand Down Expand Up @@ -2548,6 +2548,7 @@ class shader_core_ctx : public core_t {
unsigned int m_occupied_ctas;
std::bitset<MAX_THREAD_PER_SM> m_occupied_hwtid;
std::map<unsigned int, unsigned int> m_occupied_cta_to_hwtid;
const address_type null_pc = -1;
};

class exec_shader_core_ctx : public shader_core_ctx {
Expand Down

0 comments on commit a2b0318

Please sign in to comment.