How to use the accelerate.cuda.sorting function in accelerate

To help you get started, we’ve selected a few accelerate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fbpic / fbpic / fbpic / particles / cuda_methods.py View on Github external
"""
    Sort the cell index of the particles and
    modify the sorted index array accordingly.

    Parameters
    ----------
    cell_idx : 1darray of integers
        The cell index of the particle

    sorted_idx : 1darray of integers
        Represents the original index of the
        particle before the sorting.
    """
    Ntot = cell_idx.shape[0]
    if Ntot > 0:
        sorter = sorting.RadixSort(Ntot, dtype = np.int32)
        sorter.sort(cell_idx, vals = sorted_idx)

accelerate

Accelerate

Apache-2.0
Latest version published 4 days ago

Package Health Score

100 / 100
Full package analysis