summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy G Rogers <[email protected]>2018-03-25 18:28:39 -0400
committerGitHub Enterprise <[email protected]>2018-03-25 18:28:39 -0400
commitf7ff51824547d017bdfffcaff79a762ff07c6fdf (patch)
tree331aefc5a9df52299b7e0f9d8de56439cf187d36 /src
parent82a62207406739bc8597326aa473a99007029d75 (diff)
parent4e91a60a48b07f41f4bfb4d59fa2355024a3914b (diff)
Merge pull request #13 from tgrogers/dev-purdue-integration
Support for lonestar and modifying our configs to not completely screw up when the user configures the cache preference
Diffstat (limited to 'src')
-rw-r--r--src/abstract_hardware_model.h10
-rw-r--r--src/cuda-sim/cuda-sim.cc4
-rw-r--r--src/cuda-sim/ptx.y3
-rw-r--r--src/cuda-sim/ptx_ir.cc1
-rw-r--r--src/cuda-sim/ptx_ir.h7
-rw-r--r--src/cuda-sim/ptx_parser.cc4
-rw-r--r--src/cuda-sim/ptx_parser.h1
-rw-r--r--src/gpgpu-sim/gpu-sim.cc2
8 files changed, 27 insertions, 5 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index cec75f9..1b764e2 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -517,7 +517,14 @@ public:
const struct textureReference* get_texref(const std::string &texname) const
{
std::map<std::string, const struct textureReference*>::const_iterator t=m_NameToTextureRef.find(texname);
- assert( t != m_NameToTextureRef.end() );
+ if( t == m_NameToTextureRef.end() ) {
+ // search for :: prefixed names
+ std::string temp("::" + texname);
+ t=m_NameToTextureRef.find(temp);
+ }
+
+ assert(t != m_NameToTextureRef.end());
+
return t->second;
}
const struct cudaArray* get_texarray( const struct textureReference *texref ) const
@@ -568,6 +575,7 @@ struct gpgpu_ptx_sim_info
int cmem;
int gmem;
int regs;
+ unsigned maxthreads;
unsigned ptx_version;
unsigned sm_target;
};
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index 2f166aa..3d3a820 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -1159,13 +1159,13 @@ void function_info::finalize( memory_space *param_mem )
// copy the parameter over word-by-word so that parameter that crosses a memory page can be copied over
//Jin: copy parameter using aligned rules
const size_t word_size = 4;
- param_address = (param_address + size - 1) / size * size; //aligned with size
+ //param_address = (param_address + size - 1) / size * size; //aligned with size TODO: align not correct
for (size_t idx = 0; idx < size; idx += word_size) {
const char *pdata = reinterpret_cast<const char*>(param_value.pdata) + idx; // cast to char * for ptr arithmetic
param_mem->write(param_address + idx, word_size, pdata,NULL,NULL);
}
unsigned offset = p.get_offset();
- assert(offset == param_address);
+ //assert(offset == param_address);
param->set_address(param_address);
param_address += size;
}
diff --git a/src/cuda-sim/ptx.y b/src/cuda-sim/ptx.y
index e00aa4b..c0c58a6 100644
--- a/src/cuda-sim/ptx.y
+++ b/src/cuda-sim/ptx.y
@@ -228,7 +228,8 @@ function_defn: function_decl { set_symtab($1); func_header(".skip"); } statement
block_spec: MAXNTID_DIRECTIVE INT_OPERAND COMMA INT_OPERAND COMMA INT_OPERAND {func_header_info_int(".maxntid", $2);
func_header_info_int(",", $4);
- func_header_info_int(",", $6); }
+ func_header_info_int(",", $6);
+ maxnt_id($2, $4, $6);}
| MINNCTAPERSM_DIRECTIVE INT_OPERAND { func_header_info_int(".minnctapersm", $2); printf("GPGPU-Sim: Warning: .minnctapersm ignored. \n"); }
| MAXNCTAPERSM_DIRECTIVE INT_OPERAND { func_header_info_int(".maxnctapersm", $2); printf("GPGPU-Sim: Warning: .maxnctapersm ignored. \n"); }
;
diff --git a/src/cuda-sim/ptx_ir.cc b/src/cuda-sim/ptx_ir.cc
index 8ebdcf8..ee36957 100644
--- a/src/cuda-sim/ptx_ir.cc
+++ b/src/cuda-sim/ptx_ir.cc
@@ -222,6 +222,7 @@ bool symbol_table::add_function_decl( const char *name, int entry_point, functio
} else {
*func_info = new function_info(entry_point);
(*func_info)->set_name(name);
+ (*func_info)->set_maxnt_id(0);
m_function_info_lookup[key] = *func_info;
}
diff --git a/src/cuda-sim/ptx_ir.h b/src/cuda-sim/ptx_ir.h
index 9ad1571..36ef3d5 100644
--- a/src/cuda-sim/ptx_ir.h
+++ b/src/cuda-sim/ptx_ir.h
@@ -1245,6 +1245,7 @@ public:
const struct gpgpu_ptx_sim_info* get_kernel_info () const
{
+ assert (m_kernel_info.maxthreads == maxnt_id);
return &m_kernel_info;
}
@@ -1252,6 +1253,8 @@ public:
m_kernel_info = info;
m_kernel_info.ptx_version = 10*get_ptx_version().ver();
m_kernel_info.sm_target = get_ptx_version().target();
+ // THIS DEPENDS ON ptxas being called after the PTX is parsed.
+ m_kernel_info.maxthreads = maxnt_id;
}
symbol_table *get_symtab()
{
@@ -1275,7 +1278,11 @@ public:
}
bool is_entry_point() const { return m_entry_point; }
+ void set_maxnt_id(unsigned maxthreads) { maxnt_id = maxthreads;}
+ unsigned get_maxnt_id() { return maxnt_id;}
+
private:
+ unsigned maxnt_id;
unsigned m_uid;
unsigned m_local_mem_framesize;
bool m_entry_point;
diff --git a/src/cuda-sim/ptx_parser.cc b/src/cuda-sim/ptx_parser.cc
index baa3bcd..e5731a8 100644
--- a/src/cuda-sim/ptx_parser.cc
+++ b/src/cuda-sim/ptx_parser.cc
@@ -969,6 +969,10 @@ void target_header3(char* a, char* b, char* c)
g_global_symbol_table->set_sm_target(a,b,c);
}
+void maxnt_id(int x, int y, int z) {
+ g_func_info->set_maxnt_id(x * y * z);
+}
+
void func_header(const char* a) {} //intentional dummy function
void func_header_info(const char* a) {} //intentional dummy function
void func_header_info_int(const char* a, int b) {} //intentional dummy function
diff --git a/src/cuda-sim/ptx_parser.h b/src/cuda-sim/ptx_parser.h
index 32f3903..13042e1 100644
--- a/src/cuda-sim/ptx_parser.h
+++ b/src/cuda-sim/ptx_parser.h
@@ -93,6 +93,7 @@ void change_double_operand_type( int addr_type );
void change_operand_neg( );
void set_immediate_operand_type( );
void version_header(double a);
+void maxnt_id(int x, int y, int z);
//Jin: handle instructino group for cdp
void start_inst_group();
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 17f1714..bb448b3 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -245,7 +245,7 @@ void shader_core_config::reg_options(class OptionParser * opp)
"per-shader L1 data cache config "
" {<nsets>:<bsize>:<assoc>,<rep>:<wr>:<alloc>:<wr_alloc>,<mshr>:<N>:<merge>,<mq> | none}",
"none" );
- option_parser_register(opp, "-gpgpu_cache:dl1PreShared", OPT_CSTR, &m_L1D_config.m_config_stringPrefShared,
+ option_parser_register(opp, "-gpgpu_cache:dl1PrefShared", OPT_CSTR, &m_L1D_config.m_config_stringPrefShared,
"per-shader L1 data cache config "
" {<nsets>:<bsize>:<assoc>,<rep>:<wr>:<alloc>:<wr_alloc>,<mshr>:<N>:<merge>,<mq> | none}",
"none" );