public KernelConfig(Index1 gridDim, Index1 groupDim) : this(gridDim, groupDim, default) { }
public static Index1 Add(ref Index1 target, Index1 value) { return(Add(ref Unsafe.As <Index1, int>(ref target), value)); }
public static int ComputeWarpThreadIdx(Index1 groupThreadIdx) => groupThreadIdx % WarpSize;
public static Index1 Exchange(ref Index1 target, Index1 value) { return(Exchange(ref Unsafe.As <Index1, int>(ref target), value)); }
public static Index1 CompareExchange(ref Index1 target, Index1 compare, Index1 value) { return(CompareExchange(ref Unsafe.As <Index1, int>(ref target), compare, value)); }
/// <summary> /// Allocates a 3D chunk of shared memory with the specified number of elements. /// </summary> /// <typeparam name="T">The element type.</typeparam> /// <param name="width">The width of the 3D buffer.</param> /// <param name="height">The height of the 3D buffer.</param> /// <param name="depth">The depth of the 3D buffer.</param> /// <returns>An allocated region of shared memory.</returns> public static ArrayView3D <T> Allocate3D <T>( Index1 width, Index1 height, Index1 depth) where T : unmanaged => Allocate3D <T>(new Index3(width, height, depth));
public static VariableView <T> GetVariableView <T>( this ArrayView <T> view, Index1 element) where T : unmanaged => new VariableView <T>(view.GetSubView(element, 1));
/// <summary> /// Allocates a 2D chunk of shared memory with the specified number of elements. /// </summary> /// <typeparam name="T">The element type.</typeparam> /// <param name="width">The width of the 2D buffer.</param> /// <param name="height">The height of the 2D buffer.</param> /// <returns>An allocated region of shared memory.</returns> public static ArrayView2D <T> Allocate2D <T>(Index1 width, Index1 height) where T : unmanaged => Allocate2D <T>(new Index2(width, height));
/// <summary> /// Allocates a 1D chunk of shared memory with the specified number of elements. /// </summary> /// <typeparam name="T">The element type.</typeparam> /// <param name="length">The number of elements to allocate.</param> /// <returns>An allocated region of shared memory.</returns> public static ArrayView <T> Allocate <T>(Index1 length) where T : unmanaged => Allocate <T, Index1>(length).AsLinearView();
public static Index1 Add(ref Index1 target, Index1 value) => Add(ref Unsafe.As <Index1, int>(ref target), value);
public static Index1 Exchange(ref Index1 target, Index1 value) => Exchange(ref Unsafe.As <Index1, int>(ref target), value);
/// <summary> /// Allocates a 1D chunk of shared memory with the specified number of elements. /// </summary> /// <typeparam name="T">The element type.</typeparam> /// <param name="length">The number of elements to allocate.</param> /// <returns>An allocated region of shared memory.</returns> public static ArrayView <T> Allocate <T>(Index1 length) where T : struct => Allocate <T, Index1>(length).AsLinearView();