public GridOptimizerBase(int numObjects) { this.numObjects = numObjects; this.threadGroupSize = numObjects / SIMULATION_BLOCK_SIZE_FOR_GRID; bitonicSort = new BitonicSort(numObjects); }
public void TestUnalignedSizes(int count) { using (StructuredBuffer <int> buffer = new StructuredBuffer <int>(count)) { int[] testData = new int[count]; for (int i = 0; i < count; i++) { testData[i] = count - 1 - i; } buffer.SetData(testData); BitonicSort sorter = new BitonicSort(); sorter.Sort(buffer, buffer.Count); int[] result = buffer.GetData(); for (int i = 0; i < count; i++) { Assert.AreEqual(result[i], i); } } }
public unsafe void BitonicSort() => BitonicSort <T> .Sort((int *)_arrayPtrs[_iterationIndex++], N);