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)
//