summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.cc
diff options
context:
space:
mode:
authorPSuchita <[email protected]>2019-04-18 15:39:22 -0500
committerGitHub <[email protected]>2019-04-18 15:39:22 -0500
commit4d6895995b1c5548a3b5ba2e2b203048cd41628b (patch)
treed76aa0983dedcaab5f0e0a4751059e23e0a1ce78 /src/abstract_hardware_model.cc
parent73050b730b31e9f58f8c2a0bfc4b3a8cd92be7ff (diff)
parent74289a429633176e37116353347f60c75f2b644a (diff)
Merge pull request #2 from PSuchita/texture-fixes-addl
Adding additional fixes for the texture bug and adding additional configs.
Diffstat (limited to 'src/abstract_hardware_model.cc')
-rw-r--r--src/abstract_hardware_model.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/abstract_hardware_model.cc b/src/abstract_hardware_model.cc
index 3db87c9..cebdb25 100644
--- a/src/abstract_hardware_model.cc
+++ b/src/abstract_hardware_model.cc
@@ -88,8 +88,6 @@ void checkpoint::load_global_mem(class memory_space *temp_mem, char * f1name)
fclose ( fp2 );
}
-
-
void checkpoint::store_global_mem(class memory_space * mem, char *fname, char * format)
{
@@ -192,6 +190,11 @@ gpgpu_t::gpgpu_t( const gpgpu_functional_sim_config &config )
checkpoint_CTA_t = m_function_model_config.get_checkpoint_CTA_t();
checkpoint_insn_Y = m_function_model_config.get_checkpoint_insn_Y();
+ // initialize texture mappings to empty
+ m_NameToTextureInfo.clear();
+ m_NameToCudaArray.clear();
+ m_TextureRefToName.clear();
+ m_NameToAttribute.clear();
if(m_function_model_config.get_ptx_inst_debug_to_file() != 0)
ptx_inst_debug_file = fopen(m_function_model_config.get_ptx_inst_debug_file(), "w");
@@ -688,7 +691,10 @@ unsigned g_kernel_launch_latency;
unsigned kernel_info_t::m_next_uid = 1;
-kernel_info_t::kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *entry, std::map<std::string, const struct cudaArray*> NameToCudaArray, std::map<std::string, const struct textureInfo*> NameToTexureInfo)
+/*A snapshot of the texture mappings needs to be stored in the kernel's info as
+kernels should use the texture bindings seen at the time of launch and textures
+ can be bound/unbound asynchronously with respect to streams. */
+kernel_info_t::kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *entry, std::map<std::string, const struct cudaArray*> nameToCudaArray, std::map<std::string, const struct textureInfo*> nameToTextureInfo)
{
m_kernel_entry=entry;
m_grid_dim=gridDim;
@@ -708,8 +714,8 @@ kernel_info_t::kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *
m_launch_latency = g_kernel_launch_latency;
volta_cache_config_set=false;
- m_NameToCudaArray = NameToCudaArray;
- m_NameToTexureInfo = NameToTexureInfo;
+ m_NameToCudaArray = nameToCudaArray;
+ m_NameToTextureInfo = nameToTextureInfo;
}
kernel_info_t::~kernel_info_t()