summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_ir.h
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-11-09 15:33:00 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:21 -0700
commit64ecf6992b5e0400877c2d1b479dddcadac6db69 (patch)
tree29497a626d6b45d31028ae8d7caac0a6fded8f37 /src/cuda-sim/ptx_ir.h
parentc6becca8e1c9c188b515d4c66df66114ef448361 (diff)
Extended PTX parser to recognize the .ptr .shared directive and allocate shared memory buffer to those pointers. This is required to support OpenCL local memorywith the newer NVIDIA driver.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14565]
Diffstat (limited to 'src/cuda-sim/ptx_ir.h')
-rw-r--r--src/cuda-sim/ptx_ir.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cuda-sim/ptx_ir.h b/src/cuda-sim/ptx_ir.h
index ffd0c58..044bce6 100644
--- a/src/cuda-sim/ptx_ir.h
+++ b/src/cuda-sim/ptx_ir.h
@@ -994,14 +994,16 @@ private:
class param_info {
public:
- param_info() { m_valid = false; m_value_set=false; m_size = 0; }
- param_info( std::string name, int type, size_t size )
+ param_info() { m_valid = false; m_value_set=false; m_size = 0; m_is_ptr = false; }
+ param_info( std::string name, int type, size_t size, bool is_ptr, memory_space_t ptr_space )
{
m_valid = true;
m_value_set = false;
m_name = name;
m_type = type;
m_size = size;
+ m_is_ptr = is_ptr;
+ m_ptr_space = ptr_space;
}
void add_data( param_t v ) {
assert( (!m_value_set) || (m_value.size == v.size) ); // if this fails concurrent kernel launches might execute incorrectly
@@ -1014,6 +1016,7 @@ public:
int get_type() const { assert(m_valid); return m_type; }
param_t get_value() const { assert(m_value_set); return m_value; }
size_t get_size() const { assert(m_valid); return m_size; }
+ bool is_ptr_shared() const { assert(m_valid); return (m_is_ptr and m_ptr_space == shared_space); }
private:
bool m_valid;
std::string m_name;
@@ -1022,6 +1025,8 @@ private:
bool m_value_set;
param_t m_value;
unsigned m_offset;
+ bool m_is_ptr;
+ memory_space_t m_ptr_space;
};
class function_info {
@@ -1093,7 +1098,7 @@ public:
{
m_kernel_params[ name ] = value;
}
- void add_param_name_type_size( unsigned index, std::string name, int type, size_t size );
+ void add_param_name_type_size( unsigned index, std::string name, int type, size_t size, bool ptr, memory_space_t space );
void add_param_data( unsigned argn, struct gpgpu_ptx_sim_arg *args );
void add_return_var( const symbol *rv )
{