SortingNetwork.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __SORTINGNETWORK_HPP__
  2. #define __SORTINGNETWORK_HPP__
  3. #include "oasm_lib.h"
  4. #include "utils.hpp"
  5. enum OSort_Style{BUFFERS, KEY_DATA, KEY_DATAX2};
  6. void OddEvenMergeSort(unsigned char *buf, uint64_t N, size_t block_size);
  7. #if 0
  8. double DecryptAndOddEvenMergeSort(unsigned char *encrypted_buffer, uint64_t N, size_t block_size,
  9. unsigned char *result_buffer);
  10. #endif
  11. void BitonicSort(unsigned char *buffer, size_t N, size_t block_size, bool ascend);
  12. void BitonicSort(unsigned char *keys, size_t N, unsigned char *associated_data1,
  13. unsigned char *associated_data2, size_t data_size, bool ascend);
  14. template<OSwap_Style oswap_style, typename KeyType = uint64_t>
  15. void BitonicSort(unsigned char *buffer, size_t N, size_t block_size, bool ascend);
  16. template<OSwap_Style oswap_style, typename KeyType = uint64_t>
  17. inline void BitonicSort(unsigned char *keys, size_t N, unsigned char *associated_data1,
  18. unsigned char *associated_data2, size_t data_size, bool ascend);
  19. template<OSwap_Style oswap_style, typename KeyType = uint64_t>
  20. void BitonicMerge(unsigned char *keys, size_t N, unsigned char *associated_data1,
  21. unsigned char *associated_data2, size_t data_size, bool ascend);
  22. #if 0
  23. void testBitonicSort();
  24. #endif
  25. #include "SortingNetwork.tcc"
  26. #endif