0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd:🆑 Add data maps/refs counts to interface wrapping.

This commit is contained in:
Jason Volk 2022-03-11 18:57:32 -08:00
parent 5a9a5e1094
commit 9fb199ecf7
2 changed files with 22 additions and 0 deletions

View file

@ -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

View file

@ -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