def make_func_for_chunk_size(chunk_size): knl = elementwise.get_take_kernel(indices.context, a_dtype, indices.dtype, vec_count=chunk_size) knl.set_block_shape(*indices._block) return knl
def take(a, indices, out=None, queue=None): queue = queue or a.queue if out is None: out = Array(a.context, indices.shape, a.dtype, a.allocator, queue=queue) assert len(indices.shape) == 1 knl = elementwise.get_take_kernel( a.context, a.dtype, indices.dtype) knl(queue, a._global_size, a._local_size, indices.data, a.data, out.data, indices.size) return out
def take(a, indices, out=None, queue=None): queue = queue or a.queue if out is None: out = Array(a.context, indices.shape, a.dtype, a.allocator, queue=queue) assert len(indices.shape) == 1 knl = elementwise.get_take_kernel(a.context, a.dtype, indices.dtype) knl(queue, a._global_size, a._local_size, indices.data, a.data, out.data, indices.size) return out
def make_func_for_chunk_size(chunk_size): knl = elementwise.get_take_kernel( indices.context, a_dtype, indices.dtype, vec_count=chunk_size) knl.set_block_shape(*indices._block) return knl
def _take(result, ary, indices): return elementwise.get_take_kernel( result.context, result.dtype, indices.dtype)
def _take(result, ary, indices): return elementwise.get_take_kernel(result.context, result.dtype, indices.dtype)