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:
parent
63a5a6dfdd
commit
19210277a2
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
11
ircd/cl.cc
11
ircd/cl.cc
|
@ -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)
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue