/// <summary> /// Computes a new repeated sequence of values from 0 to sequenceLength, from 0 to /// sequenceLength, ... and writes the computed values to the given view. /// Afterwards, the target view will contain the following values: /// - [0, sequenceLength - 1] = [0, sequenceLength] /// - [sequenceLength, sequenceLength * 2 -1] = [0, sequenceLength] /// - ... /// </summary> /// <typeparam name="T">The element type.</typeparam> /// <typeparam name="TSequencer">The type of the sequencer to use.</typeparam> /// <param name="accelerator">The accelerator.</param> /// <param name="stream">The accelerator stream.</param> /// <param name="view">The target view.</param> /// <param name="sequenceLength">The length of a single sequence.</param> /// <param name="sequencer">The used sequencer.</param> public static void RepeatedSequence <T, TSequencer>( this Accelerator accelerator, AcceleratorStream stream, ArrayView <T> view, LongIndex1D sequenceLength, TSequencer sequencer) where T : unmanaged where TSequencer : struct, ISequencer <T> => accelerator.CreateRepeatedSequencer <T, Stride1D.Dense, TSequencer>()( stream, view, sequenceLength, sequencer);
/// <summary> /// Computes a new repeated sequence of values from 0 to sequenceLength, from 0 to sequenceLength, ... and writes /// the computed values to the given view. Afterwards, the target view will contain the following values: /// - [0, sequenceLength - 1] = [0, sequenceLength] /// - [sequenceLength, sequenceLength * 2 -1] = [0, sequenceLength] /// - ... /// </summary> /// <typeparam name="T">The element type.</typeparam> /// <typeparam name="TSequencer">The type of the sequencer to use.</typeparam> /// <param name="accelerator">The accelerator.</param> /// <param name="stream">The accelerator stream.</param> /// <param name="view">The target view.</param> /// <param name="sequenceLength">The length of a single sequence.</param> /// <param name="sequencer">The used sequencer.</param> public static void RepeatedSequence <T, TSequencer>( this Accelerator accelerator, AcceleratorStream stream, ArrayView <T> view, Index sequenceLength, TSequencer sequencer) where T : struct where TSequencer : struct, ISequencer <T> { accelerator.CreateRepeatedSequencer <T, TSequencer>()( stream, view, sequenceLength, sequencer); }