Skip to content

Commit 6491d42

Browse files
author
Raghuveer Devulapalli
committed
Add minimal network sort to avx2 files
1 parent ccd8159 commit 6491d42

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/avx2-32bit-qsort.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ struct avx2_vector<int32_t> {
6464
using ymmi_t = __m256i;
6565
using opmask_t = __m256i;
6666
static const uint8_t numlanes = 8;
67+
#ifdef XSS_MINIMAL_NETWORK_SORT
68+
static constexpr int network_sort_threshold = numlanes;
69+
#else
6770
static constexpr int network_sort_threshold = 256;
71+
#endif
6872
static constexpr int partition_unroll_factor = 4;
6973

7074
using swizzle_ops = avx2_32bit_swizzle_ops;
@@ -228,7 +232,11 @@ struct avx2_vector<uint32_t> {
228232
using ymmi_t = __m256i;
229233
using opmask_t = __m256i;
230234
static const uint8_t numlanes = 8;
235+
#ifdef XSS_MINIMAL_NETWORK_SORT
236+
static constexpr int network_sort_threshold = numlanes;
237+
#else
231238
static constexpr int network_sort_threshold = 256;
239+
#endif
232240
static constexpr int partition_unroll_factor = 4;
233241

234242
using swizzle_ops = avx2_32bit_swizzle_ops;
@@ -377,7 +385,11 @@ struct avx2_vector<float> {
377385
using ymmi_t = __m256i;
378386
using opmask_t = __m256i;
379387
static const uint8_t numlanes = 8;
388+
#ifdef XSS_MINIMAL_NETWORK_SORT
389+
static constexpr int network_sort_threshold = numlanes;
390+
#else
380391
static constexpr int network_sort_threshold = 256;
392+
#endif
381393
static constexpr int partition_unroll_factor = 4;
382394

383395
using swizzle_ops = avx2_32bit_swizzle_ops;

src/avx2-64bit-qsort.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ struct avx2_vector<int64_t> {
5555
using ymmi_t = __m256i;
5656
using opmask_t = __m256i;
5757
static const uint8_t numlanes = 4;
58+
#ifdef XSS_MINIMAL_NETWORK_SORT
59+
static constexpr int network_sort_threshold = numlanes;
60+
#else
5861
static constexpr int network_sort_threshold = 64;
62+
#endif
5963
static constexpr int partition_unroll_factor = 4;
6064

6165
using swizzle_ops = avx2_64bit_swizzle_ops;
@@ -212,7 +216,11 @@ struct avx2_vector<uint64_t> {
212216
using ymmi_t = __m256i;
213217
using opmask_t = __m256i;
214218
static const uint8_t numlanes = 4;
219+
#ifdef XSS_MINIMAL_NETWORK_SORT
220+
static constexpr int network_sort_threshold = numlanes;
221+
#else
215222
static constexpr int network_sort_threshold = 64;
223+
#endif
216224
static constexpr int partition_unroll_factor = 4;
217225

218226
using swizzle_ops = avx2_64bit_swizzle_ops;
@@ -367,7 +375,11 @@ struct avx2_vector<double> {
367375
using ymmi_t = __m256i;
368376
using opmask_t = __m256i;
369377
static const uint8_t numlanes = 4;
378+
#ifdef XSS_MINIMAL_NETWORK_SORT
379+
static constexpr int network_sort_threshold = numlanes;
380+
#else
370381
static constexpr int network_sort_threshold = 64;
382+
#endif
371383
static constexpr int partition_unroll_factor = 4;
372384

373385
using swizzle_ops = avx2_64bit_swizzle_ops;

0 commit comments

Comments
 (0)