low level representation of array

This commit is contained in:
Philippe Tillet
2015-01-18 14:52:45 -05:00
parent 16648f18e0
commit edaa821d93
17 changed files with 243 additions and 194 deletions

View File

@@ -9,20 +9,20 @@ bind_to_handle::bind_to_handle() : current_arg_(0)
{ }
//
bool bind_to_handle::bind(cl::Buffer const * ph)
bool bind_to_handle::bind(cl_mem ph)
{ return (ph==NULL)?true:memory.insert(std::make_pair((void*)ph, current_arg_)).second; }
unsigned int bind_to_handle::get(cl::Buffer const * ph)
{ return bind(ph)?current_arg_++:memory.at((void*)ph); }
unsigned int bind_to_handle::get(cl_mem ph)
{ return bind(ph)?current_arg_++:memory.at(ph); }
//
bind_all_unique::bind_all_unique() : current_arg_(0)
{ }
bool bind_all_unique::bind(cl::Buffer const *)
bool bind_all_unique::bind(cl_mem)
{return true;}
unsigned int bind_all_unique::get(cl::Buffer const *)
unsigned int bind_all_unique::get(cl_mem)
{ return current_arg_++;}
}