compile for multiple target platforms
This commit is contained in:
parent
976dfb6174
commit
b4298be6ab
11 changed files with 1359 additions and 1164 deletions
File diff suppressed because it is too large
Load diff
11
libsharp/sharp_core_avx.c
Normal file
11
libsharp/sharp_core_avx.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#if (!defined(__AVX__)) && defined(__GNUC__) && defined (__x86_64__) && (__GNUC__>=6)
|
||||
|
||||
#define XCONCATX(a,b) a##_##b
|
||||
#define XCONCATX2(a,b) XCONCATX(a,b)
|
||||
#define XARCH(a) XCONCATX2(a,ARCH)
|
||||
|
||||
#define ARCH avx
|
||||
#pragma GCC target("avx")
|
||||
#include "sharp_core_inc.c"
|
||||
|
||||
#endif
|
11
libsharp/sharp_core_avx2.c
Normal file
11
libsharp/sharp_core_avx2.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#if (!defined(__AVX2__)) && defined(__GNUC__) && defined (__x86_64__) && (__GNUC__>=6)
|
||||
|
||||
#define XCONCATX(a,b) a##_##b
|
||||
#define XCONCATX2(a,b) XCONCATX(a,b)
|
||||
#define XARCH(a) XCONCATX2(a,ARCH)
|
||||
|
||||
#define ARCH avx2
|
||||
#pragma GCC target("avx2")
|
||||
#include "sharp_core_inc.c"
|
||||
|
||||
#endif
|
11
libsharp/sharp_core_avx512f.c
Normal file
11
libsharp/sharp_core_avx512f.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#if (!defined(__AVX512F__)) && defined(__GNUC__) && defined (__x86_64__) && (__GNUC__>=6)
|
||||
|
||||
#define XCONCATX(a,b) a##_##b
|
||||
#define XCONCATX2(a,b) XCONCATX(a,b)
|
||||
#define XARCH(a) XCONCATX2(a,ARCH)
|
||||
|
||||
#define ARCH avx512f
|
||||
#pragma GCC target("avx512f")
|
||||
#include "sharp_core_inc.c"
|
||||
|
||||
#endif
|
11
libsharp/sharp_core_fma.c
Normal file
11
libsharp/sharp_core_fma.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#if (!defined(__FMA__)) && defined(__GNUC__) && defined (__x86_64__) && (__GNUC__>=6)
|
||||
|
||||
#define XCONCATX(a,b) a##_##b
|
||||
#define XCONCATX2(a,b) XCONCATX(a,b)
|
||||
#define XARCH(a) XCONCATX2(a,ARCH)
|
||||
|
||||
#define ARCH fma
|
||||
#pragma GCC target("fma")
|
||||
#include "sharp_core_inc.c"
|
||||
|
||||
#endif
|
11
libsharp/sharp_core_fma4.c
Normal file
11
libsharp/sharp_core_fma4.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#if (!defined(__FMA4__)) && defined(__GNUC__) && defined (__x86_64__) && (__GNUC__>=6)
|
||||
|
||||
#define XCONCATX(a,b) a##_##b
|
||||
#define XCONCATX2(a,b) XCONCATX(a,b)
|
||||
#define XARCH(a) XCONCATX2(a,ARCH)
|
||||
|
||||
#define ARCH fma4
|
||||
#pragma GCC target("fma4")
|
||||
#include "sharp_core_inc.c"
|
||||
|
||||
#endif
|
1175
libsharp/sharp_core_inc.c
Normal file
1175
libsharp/sharp_core_inc.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -68,5 +68,6 @@ void inner_loop (sharp_job *job, const int *ispair,const double *cth,
|
|||
|
||||
int sharp_veclen(void);
|
||||
int sharp_max_nvec(int spin);
|
||||
const char *sharp_architecture(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,9 +71,6 @@ static void MPI_status(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void vecmath_status(void)
|
||||
{ printf("Supported vector length: %d\n",sharp_veclen()); }
|
||||
|
||||
static void sharp_announce (const char *name)
|
||||
{
|
||||
size_t m, nlen=strlen(name);
|
||||
|
@ -84,7 +81,8 @@ static void sharp_announce (const char *name)
|
|||
printf("+-");
|
||||
for (m=0; m<nlen; ++m) printf("-");
|
||||
printf("-+\n\n");
|
||||
vecmath_status();
|
||||
printf("Detected hardware architecture: %s\n", sharp_architecture());
|
||||
printf("Supported vector length: %d\n", sharp_veclen());
|
||||
OpenMP_status();
|
||||
MPI_status();
|
||||
printf("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue