mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd:🆑 Add data::offset() to interface.
This commit is contained in:
parent
ce9abfb321
commit
d0c2674b3e
2 changed files with 11 additions and 0 deletions
|
@ -76,6 +76,7 @@ struct ircd::cl::data
|
|||
public:
|
||||
uint flags() const;
|
||||
size_t size() const;
|
||||
off_t offset() const;
|
||||
char *ptr() const; // host only
|
||||
|
||||
data(const size_t, const mutable_buffer &, const bool wonly = false); // device rw
|
||||
|
|
10
ircd/cl.cc
10
ircd/cl.cc
|
@ -1697,6 +1697,16 @@ const
|
|||
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
|
||||
ircd::cl::data::size()
|
||||
const
|
||||
|
|
Loading…
Reference in a new issue