Skip to content

Commit e36adbb

Browse files
committed
fix crashes Appel-M CPU, probably a bug from the compiler
1 parent d7f9e3d commit e36adbb

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

build/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export GIT_URL=$(shell sh -c 'git config --get remote.origin.url || echo "https:
44

55
export SRCS=$(BUILD_DIR)/../src
66
export CFLAGS=-fPIC -O3 -std=c++11 -Wno-deprecated -Wno-unused -Wno-deprecated-declarations
7-
export CXXFLAGS=
7+
export CXXFLAGS= -Wno-vla-extension #-flto
88
export INC=-I$(BUILD_DIR)/../include
99
ifndef HOMEBREW_PRODUCT
1010
export LIBINC=-I/usr/include -I/usr/include/jsoncpp -I/opt/local/include

include/fKb.hpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
namespace fKst {
3535

3636
template<typename T>
37-
inline __attribute__((always_inline)) void addValueB(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int i){
37+
inline /*__attribute__((always_inline))*/ void addValueB(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int i){
3838
short position=k-2;
3939
while ((data[i]>output[position]) && (position>-1) ){
4040
output[position+1]=output[position];
@@ -44,7 +44,7 @@ template<typename T>
4444
}
4545

4646
template<typename T>
47-
inline __attribute__((always_inline)) void addValueB(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, unsigned int i){
47+
inline /*__attribute__((always_inline))*/ void addValueB(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, unsigned int i){
4848
short position=k-2;
4949
while ((data[i]>output[position]) && (position>-1) ){
5050
output[position+1]=output[position];
@@ -56,7 +56,7 @@ template<typename T>
5656
}
5757

5858
template<typename T, typename urgT>
59-
inline __attribute__((always_inline)) void addValueB(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, urgT generator, unsigned &cpt, unsigned int i){
59+
inline /*__attribute__((always_inline))*/ void addValueB(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, urgT generator, unsigned &cpt, unsigned int i){
6060
short position=k-2;
6161
short positionLikeLast=k-2;
6262
while ((output[k-1]==output[positionLikeLast]) && (position>-1) ){
@@ -841,14 +841,14 @@ inline void findKBigest(const T* data,const unsigned int N,const unsigned short
841841
}
842842
#endif
843843

844-
#if __arm64__
845-
{
846-
if(std::is_same<T, float>::value){
847-
findKbigestARM(data, N, k, output);
848-
return;
849-
}
850-
}
851-
#endif
844+
// #if __arm64__
845+
// {
846+
// if(std::is_same<T, float>::value){
847+
// findKbigestARM(data, N, k, output);
848+
// return;
849+
// }
850+
// }
851+
// #endif
852852

853853
findKbigest<T>(data, N, k, output);
854854
return;
@@ -890,14 +890,14 @@ inline void findKBigest(const T* data,const unsigned int N,const unsigned short
890890
}
891891
#endif
892892

893-
#if __arm64__
894-
{
895-
if(std::is_same<T, float>::value){
896-
findKbigestARM(data, N, k, output, positionValue);
897-
return;
898-
}
899-
}
900-
#endif
893+
// #if __arm64__
894+
// {
895+
// if(std::is_same<T, float>::value){
896+
// findKbigestARM(data, N, k, output, positionValue);
897+
// return;
898+
// }
899+
// }
900+
// #endif
901901

902902
findKbigest<T>(data, N, k, output, positionValue);
903903
return;
@@ -939,14 +939,14 @@ inline void findKBigest(const T* data,const unsigned int N,const unsigned short
939939
}
940940
#endif
941941

942-
#if __arm64__
943-
{
944-
if(std::is_same<T, float>::value){
945-
findKbigestARM(data, N, k, output, positionValue, generator);
946-
return;
947-
}
948-
}
949-
#endif
942+
// #if __arm64__
943+
// {
944+
// if(std::is_same<T, float>::value){
945+
// findKbigestARM(data, N, k, output, positionValue, generator);
946+
// return;
947+
// }
948+
// }
949+
// #endif
950950

951951
findKbigest<T>(data, N, k, output, positionValue, generator);
952952
return;

include/fKs.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
namespace fKst {
3636

3737
template<typename T>
38-
inline __attribute__((always_inline)) void addValueS(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int i){
38+
inline /*__attribute__((always_inline))*/ void addValueS(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int i){
3939
short position=k-2;
4040
while ((data[i]<output[position]) && (position>-1) ){
4141
output[position+1]=output[position];
@@ -45,7 +45,7 @@ inline __attribute__((always_inline)) void addValueS(const T* data,const unsigne
4545
}
4646

4747
template<typename T>
48-
inline __attribute__((always_inline)) void addValueS(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, unsigned int i){
48+
inline /*__attribute__((always_inline))*/ void addValueS(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, unsigned int i){
4949
short position=k-2;
5050
while ((data[i]<output[position]) && (position>-1) ){
5151
output[position+1]=output[position];
@@ -57,7 +57,7 @@ inline __attribute__((always_inline)) void addValueS(const T* data,const unsigne
5757
}
5858

5959
template<typename T, typename urgT>
60-
inline __attribute__((always_inline)) void addValueS(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, urgT generator, unsigned &cpt, unsigned int i){
60+
inline /*__attribute__((always_inline))*/ void addValueS(const T* data,const unsigned int N,const unsigned short k, T* restrict output, unsigned int* restrict positionValue, urgT generator, unsigned &cpt, unsigned int i){
6161
short position=k-2;
6262
short positionLikeLast=k-2;
6363
while ((output[k-1]==output[positionLikeLast]) && (position>-1) ){

0 commit comments

Comments
 (0)