Skip to content
Snippets Groups Projects
Commit 22152498 authored by Yichao Yu's avatar Yichao Yu
Browse files

LocalMemory

parent 54f435d6
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@
- enqueue_nd_range_kernel size/offset mess
- CommandQueue.set_property
- ?LocalMemory
- GLBuffer
- GLRenderBuffer
- GLTexture
......
......@@ -658,6 +658,15 @@ class cffi_array(np.ndarray):
return self.__base
class LocalMemory(object):
__slots__ = ('_size',)
def __init__(self, size):
self._size = size
@property
def size(self):
return self._size
class MemoryObjectHolder(_Common):
def get_host_array(self, shape, dtype, order="C"):
dtype, shape, strides = _norm_shape_dtype(
......@@ -941,6 +950,9 @@ class Kernel(_Common):
elif isinstance(arg, Sampler):
_handle_error(_lib.kernel__set_arg_sampler(self.ptr, arg_index,
arg.ptr))
elif isinstance(arg, LocalMemory):
_handle_error(_lib.kernel__set_arg_buf(self.ptr, arg_index,
_ffi.NULL, arg.size))
else:
c_buf, size, _ = _c_buffer_from_obj(arg)
_handle_error(_lib.kernel__set_arg_buf(self.ptr, arg_index,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment