took out prefetch and added commented out pragmas - they not help
This commit is contained in:
parent
3fdcaad537
commit
be450086b5
11
magyarsort.h
11
magyarsort.h
@ -9,6 +9,12 @@
|
|||||||
* LICENCE: CC3 - look it up, you need to mention me but that is all
|
* LICENCE: CC3 - look it up, you need to mention me but that is all
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Does not help much:
|
||||||
|
// #pragma GCC target ("avx2")
|
||||||
|
// #pragma GCC optimization ("unroll-loops")
|
||||||
|
*/
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring> // memset
|
#include <cstring> // memset
|
||||||
@ -90,8 +96,7 @@ namespace MagyarSort {
|
|||||||
#pragma GCC unroll 64
|
#pragma GCC unroll 64
|
||||||
for(COUNTER_TYP i = 0; i < size; ++i) {
|
for(COUNTER_TYP i = 0; i < size; ++i) {
|
||||||
// Prefetch caches
|
// Prefetch caches
|
||||||
__builtin_prefetch(&arr[i]); // TODO: is good?
|
//__builtin_prefetch(&arr[i + 64]);
|
||||||
__builtin_prefetch(&arr[i + 64]);
|
|
||||||
// Creates no object, struct is empty
|
// Creates no object, struct is empty
|
||||||
OccurenceMagic<DIGITS - 1, COUNTER_TYP>(arr, i, radicsOut);
|
OccurenceMagic<DIGITS - 1, COUNTER_TYP>(arr, i, radicsOut);
|
||||||
}
|
}
|
||||||
@ -143,8 +148,10 @@ namespace MagyarSort {
|
|||||||
#pragma GCC unroll 64
|
#pragma GCC unroll 64
|
||||||
for(COUNTER_TYP i = size; i > 0; --i) { // right-to-left to ensure already sorted digits order we keep for iterations
|
for(COUNTER_TYP i = size; i > 0; --i) { // right-to-left to ensure already sorted digits order we keep for iterations
|
||||||
// Prefetch caches
|
// Prefetch caches
|
||||||
|
/*
|
||||||
__builtin_prefetch(&from[i]); // TODO: is good?
|
__builtin_prefetch(&from[i]); // TODO: is good?
|
||||||
if(i >= 64) { __builtin_prefetch(&from[i - 64]); } // TODO: manually unroll?
|
if(i >= 64) { __builtin_prefetch(&from[i - 64]); } // TODO: manually unroll?
|
||||||
|
*/
|
||||||
// Get num and its new offset / location
|
// Get num and its new offset / location
|
||||||
auto num = from[i - 1];
|
auto num = from[i - 1];
|
||||||
auto digVal = getDigit<DIGIT>(num);
|
auto digVal = getDigit<DIGIT>(num);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user