General: Internal code generator overhaul

This commit is contained in:
Philippe Tillet
2016-04-02 18:19:33 -04:00
parent 6ac5e1f55b
commit 7f77fba4d4
131 changed files with 5854 additions and 5721 deletions

View File

@@ -47,7 +47,7 @@ private:
static CUcontext context(CUdeviceptr h)
{
CUcontext res;
cuda::check(dispatch::cuPointerGetAttribute((void*)&res, CU_POINTER_ATTRIBUTE_CONTEXT, h));
check(dispatch::cuPointerGetAttribute((void*)&res, CU_POINTER_ATTRIBUTE_CONTEXT, h));
return res;
}
@@ -58,6 +58,7 @@ public:
Context const & context() const;
bool operator<(Buffer const &) const;
bool operator==(Buffer const &) const;
bool operator!=(Buffer const &) const;
handle_type& handle();
handle_type const & handle() const;
private:
@@ -66,6 +67,15 @@ private:
handle_type h_;
};
inline Buffer make_buffer(backend_type backend, cl_mem clh = 0, CUdeviceptr cuh = 0, bool take_ownership = true)
{
if(backend==OPENCL)
return Buffer(clh, take_ownership);
else
return Buffer(cuh, take_ownership);
}
}
}