Пример #1
0
 private static void BurstWorkAround()
 {
     var selectionInt = new SelectionSortJob<int>();
     selectionInt.end = 0;
     var selectionUInt = new SelectionSortJob<uint>();
     selectionUInt.end = 0;
     var selectionFloat = new SelectionSortJob<float>();
     selectionFloat.end = 0;
     var insertionInt = new InsertionSortJob<int>();
     insertionInt.end = 0;
     var insertionUInt = new InsertionSortJob<uint>();
     insertionUInt.end = 0;
     var insertionFloat = new InsertionSortJob<float>();
     insertionFloat.end = 0;
     var bubbleInt = new BubbleSortJob<int>();
     bubbleInt.end = 0;
     var bubbleUInt = new BubbleSortJob<uint>();
     bubbleUInt.end = 0;
     var bubbleFloat = new BubbleSortJob<float>();
     bubbleFloat.end = 0;
     var combInt = new BubbleSortJob<int>();
     combInt.end = 0;
     var combUInt = new BubbleSortJob<uint>();
     combUInt.end = 0;
     var combFloat = new BubbleSortJob<float>();
     combFloat.end = 0;
     var shellInt = new ShellSortJob<int>();
     shellInt.end = 0;
     var shellUInt = new ShellSortJob<uint>();
     shellUInt.end = 0;
     var shellFloat = new ShellSortJob<float>();
     shellFloat.end = 0;
     var HeapInt = new HeapSortJob<int>();
     HeapInt.end = 0;
     var HeapUInt = new HeapSortJob<uint>();
     HeapUInt.end = 0;
     var HeapFloat = new HeapSortJob<float>();
     HeapFloat.end = 0;
     var MergeInt = new MergeSortJob<int>();
     MergeInt.end = 0;
     var MergeUInt = new MergeSortJob<uint>();
     MergeUInt.end = 0;
     var MergeFloat = new MergeSortJob<float>();
     MergeFloat.end = 0;
     var MergeInsertionInt = new MergeInsertionSortJob<int>();
     MergeInsertionInt.end = 0;
     var MergeInsertionUInt = new MergeInsertionSortJob<uint>();
     MergeInsertionUInt.end = 0;
     var MergeInsertionFloat = new MergeInsertionSortJob<float>();
     MergeInsertionFloat.end = 0;
     var QuickInt = new QuickSortJob<int>();
     QuickInt.end = 0;
     var QuickUInt = new QuickSortJob<uint>();
     QuickUInt.end = 0;
     var QuickFloat = new QuickSortJob<float>();
     QuickFloat.end = 0;
 }
Пример #2
0
 public unsafe static void BubbleSort<T>(NativeArray<T> array) where T : unmanaged, System.IComparable, System.IComparable<T>
 {
     var sortJob = new BubbleSortJob<T>()
     {
         array = (T*)array.GetUnsafePtr(),
         start = 0,
         end = array.Length
     };
     sortJob.Schedule().Complete();
 }