0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-28 17:52:54 +01:00

ircd:🆑:data: Add master() method for associated memobject.

This commit is contained in:
Jason Volk 2022-05-05 16:24:01 -07:00
parent 63a5a6dfdd
commit 19210277a2
2 changed files with 12 additions and 0 deletions

View file

@ -22,6 +22,7 @@ struct ircd::cl::data
public:
explicit operator bool() const;
void *master() const;
uint flags() const;
size_t size() const;
off_t offset() const;

View file

@ -2166,6 +2166,17 @@ const
return info<uint>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), CL_MEM_FLAGS, buf);
}
void *
ircd::cl::data::master()
const
{
assert(handle);
char buf[sizeof(void *)] {0};
constexpr auto qtype(CL_MEM_ASSOCIATED_MEMOBJECT);
return info<cl_mem>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), qtype, buf);
}
//
// cl::work (event)
//