Beispiel #1
0
 public KernelConfig(Index1 gridDim, Index1 groupDim)
     : this(gridDim, groupDim, default)
 {
 }
Beispiel #2
0
 public static Index1 Add(ref Index1 target, Index1 value)
 {
     return(Add(ref Unsafe.As <Index1, int>(ref target), value));
 }
Beispiel #3
0
 public static int ComputeWarpThreadIdx(Index1 groupThreadIdx) => groupThreadIdx % WarpSize;
Beispiel #4
0
 public static Index1 Exchange(ref Index1 target, Index1 value)
 {
     return(Exchange(ref Unsafe.As <Index1, int>(ref target), value));
 }
Beispiel #5
0
 public static Index1 CompareExchange(ref Index1 target, Index1 compare, Index1 value)
 {
     return(CompareExchange(ref Unsafe.As <Index1, int>(ref target), compare, value));
 }
Beispiel #6
0
 /// <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));
Beispiel #7
0
 public static VariableView <T> GetVariableView <T>(
     this ArrayView <T> view,
     Index1 element)
     where T : unmanaged =>
 new VariableView <T>(view.GetSubView(element, 1));
Beispiel #8
0
 /// <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));
Beispiel #9
0
 /// <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();
Beispiel #10
0
 public static Index1 Add(ref Index1 target, Index1 value) =>
 Add(ref Unsafe.As <Index1, int>(ref target), value);
Beispiel #11
0
 public static Index1 Exchange(ref Index1 target, Index1 value) =>
 Exchange(ref Unsafe.As <Index1, int>(ref target), value);
Beispiel #12
0
 /// <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();