From 8085f5fd49eaab69e2d582e328bd0e77419eadb9 Mon Sep 17 00:00:00 2001 From: Dmitriy Sobolev Date: Tue, 28 May 2024 11:43:18 -0500 Subject: [PATCH] [Doc] Swap buffer and pointer APIs to align with scan docs (#1601) Signed-off-by: Dmitriy Sobolev --- .../kernel_templates/esimd/radix_sort.rst | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/documentation/library_guide/kernel_templates/esimd/radix_sort.rst b/documentation/library_guide/kernel_templates/esimd/radix_sort.rst index 90b08612786..c74ece79a27 100644 --- a/documentation/library_guide/kernel_templates/esimd/radix_sort.rst +++ b/documentation/library_guide/kernel_templates/esimd/radix_sort.rst @@ -19,57 +19,48 @@ A synopsis of the ``radix_sort`` and ``radix_sort_by_key`` functions is provided namespace oneapi::dpl::experimental::kt::gpu::esimd { // Sort a single sequence - - template - sycl::event - radix_sort (sycl::queue q, Range&& r, KernelParam param); // (1) - template sycl::event radix_sort (sycl::queue q, Iterator first, Iterator last, - KernelParam param); // (2) - - // Sort a single sequence out-of-place + KernelParam param); // (1) template + typename KernelParam, typename Range> sycl::event - radix_sort (sycl::queue q, Range1&& r, Range2&& r_out, - KernelParam param) // (3) + radix_sort (sycl::queue q, Range&& r, KernelParam param); // (2) + + // Sort a single sequence out-of-place template sycl::event radix_sort (sycl::queue q, Iterator1 first, Iterator1 last, - Iterator2 first_out, KernelParam param) // (4) - - // Sort a sequence of keys and apply the same order to a sequence of values + Iterator2 first_out, KernelParam param) // (3) template + typename KernelParam, typename Range1, typename Range2> sycl::event - radix_sort_by_key (sycl::queue q, KeysRng&& keys, - ValuesRng&& values, KernelParam param); // (5) + radix_sort (sycl::queue q, Range1&& r, Range2&& r_out, + KernelParam param) // (4) + + // Sort a sequence of keys and apply the same order to a sequence of values template sycl::event radix_sort_by_key (sycl::queue q, Iterator1 keys_first, Iterator1 keys_last, - Iterator2 values_first, KernelParam param); // (6) - - // Sort a sequence of keys and values out-of-place + Iterator2 values_first, KernelParam param); // (5) template + typename KernelParam, typename KeysRng, typename ValuesRng> sycl::event - radix_sort_by_key (sycl::queue q, KeysRng1&& keys, ValsRng1&& values, - KeysRng2&& keys_out, ValsRng2&& vals_out, - KernelParam param) // (7) + radix_sort_by_key (sycl::queue q, KeysRng&& keys, + ValuesRng&& values, KernelParam param); // (6) + + // Sort a sequence of keys and values out-of-place template + sycl::event + radix_sort_by_key (sycl::queue q, KeysRng1&& keys, ValsRng1&& values, + KeysRng2&& keys_out, ValsRng2&& vals_out, + KernelParam param) // (8) } @@ -105,18 +103,18 @@ Parameters +-----------------------------------------------+---------------------------------------------------------------------+ | | | | | The sequences to apply the algorithm to. | -| - ``r`` (1), | Supported sequence types: | -| - ``first``, ``last`` (2), | | -| - ``r``, ``r_out`` (3), | - ``sycl::buffer`` (1,3,5,7), | -| - ``first``, ``last``, ``first_out`` (4), | - :ref:`oneapi::dpl::experimental::ranges::views::all | -| - ``keys``, ``values`` (5), | ` (1,3,5,7), | -| - ``keys_first``, ``keys_last``, | - :ref:`oneapi::dpl::experimental::ranges::views::subrange | -| ``values_first`` (6), | ` (1,3,5,7), | -| - ``keys``, ``values``, | - :ref:`USM pointers ` (2,4,6,8), | -| ``keys_out``, ``values_out`` (7), | - :ref:`oneapi::dpl::begin and oneapi::dpl::end | -| - ``keys_first``, ``keys_last``, | ` (2,4,6,8). | -| ``vals_first``, ``keys_out_first``, | | -| ``values_out_first`` (8) | | +| - ``first``, ``last`` (1), | Supported sequence types: | +| - ``r`` (2), | | +| - ``first``, ``last``, ``first_out`` (3), | - :ref:`USM pointers ` (1,3,5,7), | +| - ``r``, ``r_out`` (4), | - :ref:`oneapi::dpl::begin and oneapi::dpl::end | +| - ``keys_first``, ``keys_last``, | ` (1,3,5,7). | +| ``values_first`` (5), | - ``sycl::buffer`` (2,4,6,8), | +| - ``keys``, ``values`` (6), | - :ref:`oneapi::dpl::experimental::ranges::views::all | +| - ``keys_first``, ``keys_last``, | ` (2,4,6,8), | +| ``vals_first``, ``keys_out_first``, | - :ref:`oneapi::dpl::experimental::ranges::views::subrange | +| ``values_out_first`` (7) | ` (2,4,6,8), | +| - ``keys``, ``values``, | | +| ``keys_out``, ``values_out`` (8), | | | | | +-----------------------------------------------+---------------------------------------------------------------------+ | ``param`` | A :doc:`kernel_param <../kernel_configuration>` object. | @@ -175,7 +173,7 @@ radix_sort In-Place Example keys[0] = 3, keys[1] = 2, keys[2] = 1, keys[3] = 5, keys[4] = 3, keys[5] = 3; // sort - auto e = kt::gpu::esimd::radix_sort(q, keys, keys + n, kt::kernel_param<416, 64>{}); // (2) + auto e = kt::gpu::esimd::radix_sort(q, keys, keys + n, kt::kernel_param<416, 64>{}); // (1) e.wait(); // print @@ -227,7 +225,7 @@ radix_sort_by_key In-Place Example } // sort - auto e = kt::gpu::esimd::radix_sort_by_key(q, keys, values, kt::kernel_param<96, 64>{}); // (3) + auto e = kt::gpu::esimd::radix_sort_by_key(q, keys, values, kt::kernel_param<96, 64>{}); // (6) e.wait(); // print @@ -280,7 +278,7 @@ radix_sort Out-of-Place Example keys[0] = 3, keys[1] = 2, keys[2] = 1, keys[3] = 5, keys[4] = 3, keys[5] = 3; // sort - auto e = kt::gpu::esimd::radix_sort(q, keys, keys + n, keys_out, kt::kernel_param<416, 64>{}); // (4) + auto e = kt::gpu::esimd::radix_sort(q, keys, keys + n, keys_out, kt::kernel_param<416, 64>{}); // (3) e.wait(); // print @@ -340,7 +338,7 @@ radix_sort_by_key Out-of-Place Example // sort auto e = kt::gpu::esimd::radix_sort_by_key(q, keys, values, keys_out, values_out, - kt::kernel_param<96, 64>{}); // (7) + kt::kernel_param<96, 64>{}); // (8) e.wait(); // print