PeriDyno 1.0.0
Loading...
Searching...
No Matches
VkSort.h
Go to the documentation of this file.
1#pragma once
2#include "VkDeviceArray.h"
3#include "VkProgram.h"
4
5//SortType
6#define UP 0 //1,2,3,4,5
7#define DOWN 1 //5,4,3,2,1
8namespace dyno {
12
13 struct Parameters {
22 uint32_t h;
23 uint32_t SortType;
24 uint32_t srcSize;
25 uint32_t dstSize;
27 };
28
29 template<typename T>
30 class VkSort{
31 public:
32 VkSort();
33 ~VkSort();
34
35 // suport intĄ˘ float and uint32_t types --- SortType = UP /DOWN
36 void sort(std::vector<T> &data, uint32_t SortType);
37 void sort(VkDeviceArray<T>& data, uint32_t SortType);
38
39
40 // only suport keys[int] and values[int] types --- SortType = UP /DOWN
41 void sort_by_key(std::vector<T>& keys, std::vector<T>& values, uint32_t SortType);
42 void sort_by_key(VkDeviceArray<T>& keys, VkDeviceArray<T>& values, uint32_t SortType);
43
44 private:
45 std::shared_ptr<VkProgram> mSortKernel;
46 std::shared_ptr<VkProgram> mSortByKeyKernel;
47 };
48}
49#include "VkSort.inl"
std::shared_ptr< VkProgram > mSortByKeyKernel
Definition VkSort.h:46
void sort(std::vector< T > &data, uint32_t SortType)
Definition VkSort.inl:16
void sort_by_key(std::vector< T > &keys, std::vector< T > &values, uint32_t SortType)
Definition VkSort.inl:120
std::shared_ptr< VkProgram > mSortKernel
Definition VkSort.h:45
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
implement functions for reorganizing ranges into sorted order
Definition VkSort.h:13
uint32_t dstSize
Definition VkSort.h:25
eAlgorithmVariant algorithm
Definition VkSort.h:26
uint32_t srcSize
Definition VkSort.h:24
uint32_t SortType
Definition VkSort.h:23
uint32_t h
Definition VkSort.h:22