Exemplo n.º 1
0
        internal static void ArrayInStructureKernel <T, TArraySize>(
            Index1D index,
            ArrayView <T> data,
            T c,
            int localIndex)
            where T : unmanaged
            where TArraySize : unmanaged, ILength
        {
            TArraySize arraySize    = default;
            var        array        = new T[arraySize.Length];
            var        nestedStruct = new ArrayInStruct <T>(array);

            for (int i = 0; i < arraySize.Length; ++i)
            {
                nestedStruct[i] = c;
            }
            data[index] = GetValue(nestedStruct, localIndex);
        }
Exemplo n.º 2
0
 private static T GetValue <T>(ArrayInStruct <T> data, int index)
     where T : unmanaged =>
 data[index];