-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathsort.h
More file actions
64 lines (51 loc) · 1.22 KB
/
sort.h
File metadata and controls
64 lines (51 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef GPUARRAY_SORT_H
#define GPUARRAY_SORT_H
/** \file sort.h
* \brief Sort operations generator.
*/
#include <gpuarray/buffer.h>
#include <gpuarray/array.h>
#include <gpuarray/kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef CONFUSE_EMACS
}
#endif
#define SHARED_SIZE_LIMIT 1024U
#define SAMPLE_STRIDE 128
typedef struct _GpuSortData {
GpuArray BufKey;
GpuArray BufArg;
GpuArray d_RanksA;
GpuArray d_RanksB;
GpuArray d_LimitsA;
GpuArray d_LimitsB;
} GpuSortData;
typedef struct _GpuSortConfig {
unsigned int dims;
unsigned int Nfloor;
int Nleft;
unsigned int sortDirFlg;
unsigned int argSortFlg;
int typecodeKey;
size_t typesizeKey;
int typecodeArg;
size_t typesizeArg;
} GpuSortConfig;
typedef struct _GpuSortBuffers {
GpuArray BufKey;
GpuArray BufArg;
} GpuSortBuff;
typedef struct _GpuSortKernels {
GpuKernel k_bitonic;
GpuKernel k_ranks;
GpuKernel k_ranks_idxs;
GpuKernel k_merge;
GpuKernel k_merge_global;
} GpuSortKernels;
int GpuArray_sort(GpuArray *r, GpuArray *a, unsigned int sortDir, GpuArray *dstArg);
#ifdef __cplusplus
}
#endif
#endif