mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd:🆑 Add data maps/refs counts to interface wrapping.
This commit is contained in:
parent
5a9a5e1094
commit
9fb199ecf7
2 changed files with 22 additions and 0 deletions
|
@ -24,6 +24,8 @@ struct ircd::cl::data
|
|||
size_t size() const;
|
||||
off_t offset() const;
|
||||
char *ptr() const; // host only
|
||||
size_t maps() const;
|
||||
size_t refs() const;
|
||||
|
||||
data(const size_t, const bool host_rd = false, const bool host_wr = false);
|
||||
data(const mutable_buffer &, const bool dev_wonly = false); // host rw
|
||||
|
|
20
ircd/cl.cc
20
ircd/cl.cc
|
@ -2326,6 +2326,26 @@ catch(const std::exception &e)
|
|||
return;
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::cl::data::refs()
|
||||
const
|
||||
{
|
||||
assert(handle);
|
||||
|
||||
char buf[sizeof(size_t)] {0};
|
||||
return info<uint>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), CL_MEM_REFERENCE_COUNT, buf);
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::cl::data::maps()
|
||||
const
|
||||
{
|
||||
assert(handle);
|
||||
|
||||
char buf[sizeof(size_t)] {0};
|
||||
return info<uint>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), CL_MEM_MAP_COUNT, buf);
|
||||
}
|
||||
|
||||
char *
|
||||
ircd::cl::data::ptr()
|
||||
const
|
||||
|
|
Loading…
Reference in a new issue