0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd:🆑 Add data::offset() to interface.

This commit is contained in:
Jason Volk 2021-09-15 04:32:38 -07:00
parent ce9abfb321
commit d0c2674b3e
2 changed files with 11 additions and 0 deletions

View file

@ -76,6 +76,7 @@ struct ircd::cl::data
public: public:
uint flags() const; uint flags() const;
size_t size() const; size_t size() const;
off_t offset() const;
char *ptr() const; // host only char *ptr() const; // host only
data(const size_t, const mutable_buffer &, const bool wonly = false); // device rw data(const size_t, const mutable_buffer &, const bool wonly = false); // device rw

View file

@ -1697,6 +1697,16 @@ const
return info<char *>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), CL_MEM_SIZE, buf); return info<char *>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), CL_MEM_SIZE, buf);
} }
off_t
ircd::cl::data::offset()
const
{
assert(handle);
char buf[sizeof(off_t)] {0};
return info<off_t>(clGetMemObjectInfo, cl_mem(mutable_cast(handle)), CL_MEM_OFFSET, buf);
}
size_t size_t
ircd::cl::data::size() ircd::cl::data::size()
const const