diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cuda-sim/ptx_ir.cc | 27 | ||||
| -rw-r--r-- | src/gpgpu-sim/shader.cc | 1 | ||||
| -rw-r--r-- | src/gpgpu-sim/shader.h | 1 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/cuda-sim/ptx_ir.cc b/src/cuda-sim/ptx_ir.cc index 678febf..242901b 100644 --- a/src/cuda-sim/ptx_ir.cc +++ b/src/cuda-sim/ptx_ir.cc @@ -1183,6 +1183,8 @@ ptx_instruction::ptx_instruction( int opcode, m_source_file = file?file:"<unknown>"; m_source_line = line; m_source = source; + // Trim tabs + m_source.erase( std::remove( m_source.begin(), m_source.end(), '\t' ), m_source.end() ); if (opcode == CALL_OP) { const operand_info &target = func_addr(); @@ -1211,21 +1213,18 @@ void ptx_instruction::print_insn( FILE *fp ) const std::string ptx_instruction::to_string() const { - std::string result( m_source ); - unsigned semi_c_pos = result.find(";"); - assert( semi_c_pos != std::string::npos ); + char buf[ STR_SIZE ]; + unsigned used_bytes = 0; if( !is_label() ) { - char buf[ STR_SIZE ]; - buf[ STR_SIZE - 1 ] = '\0'; - snprintf( buf, STR_SIZE, " PC=0x%03x ", m_PC ); - result += std::string( buf ); - } else - result += std::string(" "); - char buf[STR_SIZE]; - buf[STR_SIZE - 1] = '\0'; - snprintf( buf, STR_SIZE, - "(%s:%d) %s", m_source_file.c_str(), m_source_line, m_source.c_str() + semi_c_pos ); - return result; + used_bytes += snprintf( buf + used_bytes, STR_SIZE - used_bytes, " PC=0x%03x ", m_PC ); + } else { + used_bytes += snprintf( buf + used_bytes, STR_SIZE - used_bytes, " " ); + } + used_bytes += snprintf( buf + used_bytes, STR_SIZE - used_bytes, + "(%s:%d) %s", + m_source_file.c_str(), m_source_line, + m_source.c_str() ); + return std::string( buf ); } unsigned function_info::sm_next_uid = 1; diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc index 9d974db..797ebc0 100644 --- a/src/gpgpu-sim/shader.cc +++ b/src/gpgpu-sim/shader.cc @@ -786,7 +786,6 @@ void scheduler_unit::order_by_priority( std::vector< T >& result_list, result_list.clear(); typename std::vector< T > temp = input_list; - if ( ORDERING_GREEDY_THEN_PRIORITY_FUNC == ordering ) { T greedy_value = *last_issued_from_input; result_list.push_back( greedy_value ); diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h index 952651e..fd1cb88 100644 --- a/src/gpgpu-sim/shader.h +++ b/src/gpgpu-sim/shader.h @@ -101,6 +101,7 @@ public: assert( m_inst_in_pipeline==0); m_imiss_pending=false; m_warp_id=(unsigned)-1; + m_dynamic_warp_id = (unsigned)-1; n_completed = m_warp_size; m_n_atomic=0; m_membar=false; |
