_cl_mem::_cl_mem(clover::context &ctx, cl_mem_flags flags,
size_t size, void *host_ptr) :
- ctx(ctx), __flags(flags),
- __size(size), __host_ptr(host_ptr),
- __destroy_notify([]{}) {
+ ctx(ctx), _flags(flags),
+ _size(size), _host_ptr(host_ptr),
+ _destroy_notify([]{}) {
if (flags & CL_MEM_COPY_HOST_PTR)
data.append((char *)host_ptr, size);
}
_cl_mem::~_cl_mem() {
- __destroy_notify();
+ _destroy_notify();
}
void
_cl_mem::destroy_notify(std::function<void ()> f) {
- __destroy_notify = f;
+ _destroy_notify = f;
}
cl_mem_flags
_cl_mem::flags() const {
- return __flags;
+ return _flags;
}
size_t
_cl_mem::size() const {
- return __size;
+ return _size;
}
void *
_cl_mem::host_ptr() const {
- return __host_ptr;
+ return _host_ptr;
}
buffer::buffer(clover::context &ctx, cl_mem_flags flags,
size_t offset, size_t size) :
buffer(parent.ctx, flags, size,
(char *)parent.host_ptr() + offset),
- parent(parent), __offset(offset) {
+ parent(parent), _offset(offset) {
}
clover::resource &
size_t
sub_buffer::offset() const {
- return __offset;
+ return _offset;
}
image::image(clover::context &ctx, cl_mem_flags flags,
size_t row_pitch, size_t slice_pitch, size_t size,
void *host_ptr) :
memory_obj(ctx, flags, size, host_ptr),
- __format(*format), __width(width), __height(height), __depth(depth),
- __row_pitch(row_pitch), __slice_pitch(slice_pitch) {
+ _format(*format), _width(width), _height(height), _depth(depth),
+ _row_pitch(row_pitch), _slice_pitch(slice_pitch) {
}
clover::resource &
cl_image_format
image::format() const {
- return __format;
+ return _format;
}
size_t
image::width() const {
- return __width;
+ return _width;
}
size_t
image::height() const {
- return __height;
+ return _height;
}
size_t
image::depth() const {
- return __depth;
+ return _depth;
}
size_t
image::row_pitch() const {
- return __row_pitch;
+ return _row_pitch;
}
size_t
image::slice_pitch() const {
- return __slice_pitch;
+ return _slice_pitch;
}
image2d::image2d(clover::context &ctx, cl_mem_flags flags,