OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InPlaceSortImpl.cu File Reference
+ Include dependency graph for InPlaceSortImpl.cu:

Go to the source code of this file.

Functions

void sort_on_gpu (int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes, ThrustAllocator &alloc)
 
void sort_on_cpu (int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes)
 
void apply_permutation_on_gpu (int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const uint32_t chosen_bytes, ThrustAllocator &alloc)
 
void apply_permutation_on_cpu (int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, int64_t *tmp_buff, const uint32_t chosen_bytes)
 

Function Documentation

void apply_permutation_on_cpu ( int64_t *  val_buff,
int32_t *  idx_buff,
const uint64_t  entry_count,
int64_t *  tmp_buff,
const uint32_t  chosen_bytes 
)

Definition at line 157 of file InPlaceSortImpl.cu.

References apply_permutation_on_cpu().

Referenced by apply_permutation_cpu(), and apply_permutation_on_cpu().

161  {
162 #ifdef HAVE_CUDA
163  switch (chosen_bytes) {
164  case 1:
165  apply_permutation_on_cpu(reinterpret_cast<int8_t*>(val_buff),
166  idx_buff,
167  entry_count,
168  reinterpret_cast<int8_t*>(tmp_buff));
169  break;
170  case 2:
171  apply_permutation_on_cpu(reinterpret_cast<int16_t*>(val_buff),
172  idx_buff,
173  entry_count,
174  reinterpret_cast<int16_t*>(tmp_buff));
175  break;
176  case 4:
177  apply_permutation_on_cpu(reinterpret_cast<int32_t*>(val_buff),
178  idx_buff,
179  entry_count,
180  reinterpret_cast<int32_t*>(tmp_buff));
181  break;
182  case 8:
183  apply_permutation_on_cpu(val_buff, idx_buff, entry_count, tmp_buff);
184  break;
185  default:
186  // FIXME(miyu): CUDA linker doesn't accept assertion on GPU yet right now.
187  break;
188  }
189 #endif
190 }
void apply_permutation_on_cpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, int64_t *tmp_buff, const uint32_t chosen_bytes)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void apply_permutation_on_gpu ( int64_t *  val_buff,
int32_t *  idx_buff,
const uint64_t  entry_count,
const uint32_t  chosen_bytes,
ThrustAllocator alloc 
)

Definition at line 128 of file InPlaceSortImpl.cu.

References apply_permutation_on_gpu().

Referenced by anonymous_namespace{InPlaceSort.cpp}::apply_permutation_gpu(), and apply_permutation_on_gpu().

132  {
133 #ifdef HAVE_CUDA
134  switch (chosen_bytes) {
135  case 1:
137  reinterpret_cast<int8_t*>(val_buff), idx_buff, entry_count, alloc);
138  break;
139  case 2:
141  reinterpret_cast<int16_t*>(val_buff), idx_buff, entry_count, alloc);
142  break;
143  case 4:
145  reinterpret_cast<int32_t*>(val_buff), idx_buff, entry_count, alloc);
146  break;
147  case 8:
148  apply_permutation_on_gpu(val_buff, idx_buff, entry_count, alloc);
149  break;
150  default:
151  // FIXME(miyu): CUDA linker doesn't accept assertion on GPU yet right now.
152  break;
153  }
154 #endif
155 }
void apply_permutation_on_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const uint32_t chosen_bytes, ThrustAllocator &alloc)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void sort_on_cpu ( int64_t *  val_buff,
int32_t *  idx_buff,
const uint64_t  entry_count,
const bool  desc,
const uint32_t  chosen_bytes 
)

Definition at line 102 of file InPlaceSortImpl.cu.

References sort_on_cpu().

Referenced by sort_groups_cpu(), and sort_on_cpu().

106  {
107 #ifdef HAVE_CUDA
108  switch (chosen_bytes) {
109  case 1:
110  sort_on_cpu(reinterpret_cast<int8_t*>(val_buff), idx_buff, entry_count, desc);
111  break;
112  case 2:
113  sort_on_cpu(reinterpret_cast<int16_t*>(val_buff), idx_buff, entry_count, desc);
114  break;
115  case 4:
116  sort_on_cpu(reinterpret_cast<int32_t*>(val_buff), idx_buff, entry_count, desc);
117  break;
118  case 8:
119  sort_on_cpu(val_buff, idx_buff, entry_count, desc);
120  break;
121  default:
122  // FIXME(miyu): CUDA linker doesn't accept assertion on GPU yet right now.
123  break;
124  }
125 #endif
126 }
void sort_on_cpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void sort_on_gpu ( int64_t *  val_buff,
int32_t *  idx_buff,
const uint64_t  entry_count,
const bool  desc,
const uint32_t  chosen_bytes,
ThrustAllocator alloc 
)

Definition at line 72 of file InPlaceSortImpl.cu.

References sort_on_gpu().

Referenced by QueryExecutionContext::QueryExecutionContext(), anonymous_namespace{InPlaceSort.cpp}::sort_groups_gpu(), and sort_on_gpu().

77  {
78 #ifdef HAVE_CUDA
79  switch (chosen_bytes) {
80  case 1:
82  reinterpret_cast<int8_t*>(val_buff), idx_buff, entry_count, desc, alloc);
83  break;
84  case 2:
86  reinterpret_cast<int16_t*>(val_buff), idx_buff, entry_count, desc, alloc);
87  break;
88  case 4:
90  reinterpret_cast<int32_t*>(val_buff), idx_buff, entry_count, desc, alloc);
91  break;
92  case 8:
93  sort_on_gpu(val_buff, idx_buff, entry_count, desc, alloc);
94  break;
95  default:
96  // FIXME(miyu): CUDA linker doesn't accept assertion on GPU yet right now.
97  break;
98  }
99 #endif
100 }
void sort_on_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes, ThrustAllocator &alloc)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: