Beispiel #1
0
        private ArrayView <int> AllocateTempRadixSortView <T, TRadixSortOperation>(ArrayView <T> input)
            where T : unmanaged
            where TRadixSortOperation : struct, IRadixSortOperation <T>
        {
            var tempSize = Accelerator.ComputeRadixSortTempStorageSize <T, TRadixSortOperation>(input.Length);

            return(bufferCache.Allocate <int>(tempSize));
        }
Beispiel #2
0
        private ArrayView <Index> AllocateTempRadixSortView <T>(ArrayView <T> input)
            where T : struct
        {
            var tempSize = Accelerator.ComputeRadixSortTempStorageSize(input.Length);

            if (tempSize < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(input));
            }
            return(bufferCache.Allocate <Index>(tempSize));
        }