summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.h
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-09-01 04:53:32 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:48:54 -0700
commit23040dd42f1fb134da159a5ddf1d593b5d818122 (patch)
treedee65f75f92c2643850fd2954cdbea28d5f75be6 /src/abstract_hardware_model.h
parent66a788b7463bb92595977c7540afa8a2adba2726 (diff)
Adding support for cudaReadModeNormalizedFloat (a texture read mode). See bug 18 (external) for detail. The blocked SDK benchmarks are still not working due to mismatch of texture element layout in memory between real GPU and GPGPU-Sim.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13933]
Diffstat (limited to 'src/abstract_hardware_model.h')
-rw-r--r--src/abstract_hardware_model.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 766dff1..b6a4111 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -318,6 +318,21 @@ struct textureReference {
#endif
+// Struct that record other attributes in the textureReference declaration
+// - These attributes are passed thru __cudaRegisterTexture()
+struct textureReferenceAttr {
+ const struct textureReference *m_texref;
+ int m_dim;
+ enum cudaTextureReadMode m_readmode;
+ int m_ext;
+ textureReferenceAttr(const struct textureReference *texref,
+ int dim,
+ enum cudaTextureReadMode readmode,
+ int ext)
+ : m_texref(texref), m_dim(dim), m_readmode(readmode), m_ext(ext)
+ { }
+};
+
class gpgpu_functional_sim_config
{
public:
@@ -364,7 +379,7 @@ public:
class memory_space *get_surf_memory() { return m_surf_mem; }
void gpgpu_ptx_sim_bindTextureToArray(const struct textureReference* texref, const struct cudaArray* array);
- void gpgpu_ptx_sim_bindNameToTexture(const char* name, const struct textureReference* texref);
+ void gpgpu_ptx_sim_bindNameToTexture(const char* name, const struct textureReference* texref, int dim, int readmode, int ext);
const char* gpgpu_ptx_sim_findNamefromTexture(const struct textureReference* texref);
const struct textureReference* get_texref(const std::string &texname) const
@@ -386,6 +401,13 @@ public:
return t->second;
}
+ const struct textureReferenceAttr* get_texattr( const struct textureReference *texref ) const
+ {
+ std::map<const struct textureReference*, const struct textureReferenceAttr*>::const_iterator t=m_TextureRefToAttribute.find(texref);
+ assert(t != m_TextureRefToAttribute.end());
+ return t->second;
+ }
+
const gpgpu_functional_sim_config &get_config() const { return m_function_model_config; }
FILE* get_ptx_inst_debug_file() { return ptx_inst_debug_file; }
@@ -402,6 +424,7 @@ protected:
std::map<std::string, const struct textureReference*> m_NameToTextureRef;
std::map<const struct textureReference*,const struct cudaArray*> m_TextureRefToCudaArray;
std::map<const struct textureReference*, const struct textureInfo*> m_TextureRefToTexureInfo;
+ std::map<const struct textureReference*, const struct textureReferenceAttr*> m_TextureRefToAttribute;
};
struct gpgpu_ptx_sim_kernel_info