Skip to content
Snippets Groups Projects
Commit 81383aa0 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Add version markers to the parallel algorithms.

parent ec2a4c6f
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,8 @@ def copy_if(ary, predicate, extra_args=[], queue=None, preamble=""): ...@@ -63,6 +63,8 @@ def copy_if(ary, predicate, extra_args=[], queue=None, preamble=""):
:returns: a tuple *(out, count)* where *out* is the output array and *count* :returns: a tuple *(out, count)* where *out* is the output array and *count*
is an on-device scalar (fetch to host with `count.get()`) indicating is an on-device scalar (fetch to host with `count.get()`) indicating
how many elements satisfied *predicate*. how many elements satisfied *predicate*.
.. versionadded:: 2012.2
""" """
if len(ary) > np.iinfo(np.int32).max: if len(ary) > np.iinfo(np.int32).max:
scan_dtype = np.int64 scan_dtype = np.int64
...@@ -96,6 +98,8 @@ def remove_if(ary, predicate, extra_args=[], queue=None, preamble=""): ...@@ -96,6 +98,8 @@ def remove_if(ary, predicate, extra_args=[], queue=None, preamble=""):
:returns: a tuple *(out, count)* where *out* is the output array and *count* :returns: a tuple *(out, count)* where *out* is the output array and *count*
is an on-device scalar (fetch to host with `count.get()`) indicating is an on-device scalar (fetch to host with `count.get()`) indicating
how many elements did not satisfy *predicate*. how many elements did not satisfy *predicate*.
.. versionadded:: 2012.2
""" """
return copy_if(ary, "!(%s)" % predicate, extra_args=extra_args, queue=queue, return copy_if(ary, "!(%s)" % predicate, extra_args=extra_args, queue=queue,
preamble=preamble) preamble=preamble)
...@@ -132,6 +136,8 @@ def partition(ary, predicate, extra_args=[], queue=None, preamble=""): ...@@ -132,6 +136,8 @@ def partition(ary, predicate, extra_args=[], queue=None, preamble=""):
:returns: a tuple *(out_true, out_false, count)* where *count* :returns: a tuple *(out_true, out_false, count)* where *count*
is an on-device scalar (fetch to host with `count.get()`) indicating is an on-device scalar (fetch to host with `count.get()`) indicating
how many elements satisfied the predicate. how many elements satisfied the predicate.
.. versionadded:: 2012.2
""" """
if len(ary) > np.iinfo(np.uint32).max: if len(ary) > np.iinfo(np.uint32).max:
scan_dtype = np.uint64 scan_dtype = np.uint64
...@@ -188,6 +194,8 @@ def unique(ary, is_equal_expr="a == b", extra_args=[], queue=None, preamble=""): ...@@ -188,6 +194,8 @@ def unique(ary, is_equal_expr="a == b", extra_args=[], queue=None, preamble=""):
:returns: a tuple *(out, count)* where *out* is the output array and *count* :returns: a tuple *(out, count)* where *out* is the output array and *count*
is an on-device scalar (fetch to host with `count.get()`) indicating is an on-device scalar (fetch to host with `count.get()`) indicating
how many elements satisfied the predicate. how many elements satisfied the predicate.
.. versionadded:: 2012.2
""" """
if len(ary) > np.iinfo(np.uint32).max: if len(ary) > np.iinfo(np.uint32).max:
...@@ -337,6 +345,8 @@ RADIX_SORT_OUTPUT_STMT_TPL = Template(r"""//CL// ...@@ -337,6 +345,8 @@ RADIX_SORT_OUTPUT_STMT_TPL = Template(r"""//CL//
class RadixSort(object): class RadixSort(object):
"""Provides a general `radix sort <https://en.wikipedia.org/wiki/Radix_sort>`_ """Provides a general `radix sort <https://en.wikipedia.org/wiki/Radix_sort>`_
on the compute device. on the compute device.
.. versionadded:: 2012.2
""" """
def __init__(self, context, arguments, key_expr, sort_arg_names, def __init__(self, context, arguments, key_expr, sort_arg_names,
bits_at_a_time=2, index_dtype=np.int32, key_dtype=np.uint32, bits_at_a_time=2, index_dtype=np.int32, key_dtype=np.uint32,
......
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