Core: fixed handle wrapping for CUcontext

This commit is contained in:
Philippe Tillet
2015-11-21 13:57:05 -05:00
parent f653625aa9
commit 6be5929b0d
14 changed files with 59 additions and 12 deletions

View File

@@ -93,6 +93,15 @@ void backend::contexts::release()
cache_.clear();
}
Context const & backend::contexts::import(CUcontext context)
{
for(driver::Context const * x: cache_)
if(x->handle().cu()==context)
return *x;
cache_.emplace_back(new Context(context, false));
return *cache_.back();
}
Context const & backend::contexts::import(cl_context context)
{
for(driver::Context const * x: cache_)