/// <summary> /// Performs a reduction using an atomic reduction logic. /// </summary> /// <typeparam name="T">The underlying type of the reduction.</typeparam> /// <typeparam name="TShuffleDown">The type of the shuffle logic.</typeparam> /// <typeparam name="TReduction">The type of the reduction logic.</typeparam> /// <param name="accelerator">The accelerator.</param> /// <param name="input">The input elements to reduce.</param> /// <param name="shuffleDown">The shuffle logic.</param> /// <param name="reduction">The reduction logic.</param> /// <remarks>Uses the internal cache to realize a temporary output buffer.</remarks> /// <returns>The reduced value.</returns> public static Task <T> AtomicReduceAsync <T, TShuffleDown, TReduction>( this Accelerator accelerator, ArrayView <T> input, TShuffleDown shuffleDown, TReduction reduction) where T : struct where TShuffleDown : struct, IShuffleDown <T> where TReduction : struct, IAtomicReduction <T> { return(accelerator.AtomicReduceAsync( accelerator.DefaultStream, input, shuffleDown, reduction)); }