Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
d16d9d94
Commit
d16d9d94
authored
Jul 11, 2013
by
Uwe Schulzweida
Browse files
cgribexlib update
parent
c2a7b034
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cgribexlib.c
View file @
d16d9d94
/* Automatically generated by m214003 at 2013-07-1
0
, do not edit */
/* Automatically generated by m214003 at 2013-07-1
1
, do not edit */
/* CGRIBEXLIB_VERSION="1.6.2" */
...
...
@@ -639,14 +639,6 @@ double intpow2(int x)
//#undef _GET_MACH_COUNTER
//#undef _ARCH_PWR6
#if defined(__GNUC__) && (__GNUC__ >= 4)
#elif defined(__ICC) && (__ICC >= 1100)
#elif defined(__clang__)
#define ENABLE_SIMD
#else
#define DISABLE_SIMD
#endif
#if defined _GET_IBM_COUNTER
#include
<libhpc.h>
#elif defined _GET_X86_COUNTER
...
...
@@ -655,38 +647,45 @@ double intpow2(int x)
#include
<mach/mach_time.h>
#endif
#if defined(__GNUC__) && (__GNUC__ >= 4)
#elif defined(__ICC) && (__ICC >= 1100)
#elif defined(__clang__)
#else
#define DISABLE_SIMD
#endif
#define DISABLE_SIMD
#undef ENABLE_SIMD
#ifdef DISABLE_SIMD
#ifdef ENABLE_AVX
#define ENABLE_SIMD
#else
#undef __AVX__
#endif
#ifdef ENABLE_SSE2
#define ENABLE_SIMD
#else
#undef __SSE2__
#endif
# ifdef ENABLE_AVX
# define _ENABLE_AVX
# endif
# ifdef ENABLE_SSE2
# define _ENABLE_SSE2
# endif
#endif
#if defined (ENABLE_SIMD)
#ifndef DISABLE_SIMD
# ifdef __AVX__
# define _ENABLE_AVX
# endif
# ifdef __SSE2__
# define _ENABLE_SSE2
# endif
#endif
#if defined __AVX__
#include
<float.h>
#include
<stdint.h>
#include
<inttypes.h>
#if defined _ENABLE_AVX
#include
<immintrin.h>
#elif defined __SSE2__
#include
<float.h>
#include
<stdint.h>
#include
<inttypes.h>
#elif defined _ENABLE_SSE2
#include
<emmintrin.h>
#endif
#if defined __AVX
__
#if defined _
ENABLE
_AVX
static
void
avx_minmax_val
(
const
double
*
restrict
buf
,
size_t
nframes
,
double
*
min
,
double
*
max
)
...
...
@@ -780,7 +779,7 @@ void avx_minmax_val(const double *restrict buf, size_t nframes, double *min, dou
return
;
}
#elif defined __SSE2
__
#elif defined _
ENABLE
_SSE2
static
void
sse2_minmax_val
(
const
double
*
restrict
buf
,
size_t
nframes
,
double
*
min
,
double
*
max
)
...
...
@@ -857,9 +856,7 @@ void sse2_minmax_val(const double *restrict buf, size_t nframes, double *min, do
return
;
}
#endif
#endif // ENABLE_SIMD
#endif // SIMD
#ifdef _ARCH_PWR6
static
...
...
@@ -959,11 +956,11 @@ void minmax_val(const double *restrict data, long idatasize, double *fmin, doubl
start_minmax
=
mach_absolute_time
();
#endif
#if defined _
_AVX__ && defined (
ENABLE_
SIMD)
#if defined _ENABLE_
AVX
avx_minmax_val
(
data
,
datasize
,
fmin
,
fmax
);
#elif defined _
_SSE2__ && defined (
ENABLE_S
IMD)
#elif defined _ENABLE_S
SE2
sse2_minmax_val
(
data
,
datasize
,
fmin
,
fmax
);
...
...
@@ -1008,28 +1005,37 @@ void minmax_val(const double *restrict data, long idatasize, double *fmin, doubl
#ifdef _GET_MACH_COUNTER
end_minmax
=
mach_absolute_time
();
#endif
#if defined __AVX__
printf
(
"AVX minmax cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#if defined _ENABLE_AVX
printf
(
"AVX minmax cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
fprintf
(
stderr
,
"AVX min: %lf max: %lf
\n
"
,
*
fmin
,
*
fmax
);
#elif defined __SSE2__
printf
(
"SSE2 minmax cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#elif defined _ENABLE_SSE2
printf
(
"SSE2 minmax cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
fprintf
(
stderr
,
"SSE2 min: %lf max: %lf
\n
"
,
*
fmin
,
*
fmax
);
#else
printf
(
"loop minmax cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
printf
(
"loop minmax cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
fprintf
(
stderr
,
"loop min: %lf max: %lf
\n
"
,
*
fmin
,
*
fmax
);
#endif
#endif
return
;
}
#undef DISABLE_SIMD
#undef _ENABLE_AVX
#undef _ENABLE_SSE2
//#undef _GET_X86_COUNTER
//#undef _GET_MACH_COUNTER
//#undef _GET_IBM_COUNTER
//#undef _ARCH_PWR6
#if defined _GET_IBM_COUNTER
#include
<libhpc.h>
#elif defined _GET_X86_COUNTER
#include
<x86intrin.h>
#elif defined _GET_MACH_COUNTER
#include
<mach/mach_time.h>
#endif
#include
<stdint.h>
#if defined(__GNUC__) && (__GNUC__ >= 4)
...
...
@@ -1039,32 +1045,33 @@ void minmax_val(const double *restrict data, long idatasize, double *fmin, doubl
#define DISABLE_SIMD
#endif
#if defined _GET_IBM_COUNTER
#include
<libhpc.h>
#elif defined _GET_X86_COUNTER
#include
<x86intrin.h>
#elif defined _GET_MACH_COUNTER
#include
<mach/mach_time.h>
#endif
//#define DISABLE_SIMD
#ifdef DISABLE_SIMD
#ifndef ENABLE_AVX
#undef __AVX__
#endif
#ifndef ENABLE_SSE4_1
#undef __SSE4_1__
# ifdef ENABLE_AVX
# define _ENABLE_AVX
# endif
# ifdef ENABLE_SSE4_1
# define _ENABLE_SSE4_1
# endif
#endif
#ifndef DISABLE_SIMD
# ifdef __AVX__
# define _ENABLE_AVX
# endif
# ifdef __SSE4_1__
# define _ENABLE_SSE4_1
# endif
#endif
#if defined __AVX
__
#if defined _
ENABLE
_AVX
#include
<immintrin.h>
#elif defined __SSE4_1
__
#elif defined _
ENABLE
_SSE4_1
#include
<smmintrin.h>
#endif
#if defined __AVX
__
#if defined _
ENABLE
_AVX
static
void
avx_encode_double_array_2byte
(
size_t
datasize
,
...
...
@@ -1165,7 +1172,7 @@ void avx_encode_double_array_2byte(size_t datasize,
return
;
}
#elif defined __SSE4_1
__
#elif defined _
ENABLE
_SSE4_1
static
void
sse41_encode_double_array_2byte
(
size_t
datasize
,
...
...
@@ -1424,11 +1431,11 @@ void encode_double_array_byte(int numBits, size_t packStart, size_t datasize,
start_minmax
=
mach_absolute_time
();
#endif
#if defined __AVX
__
#if defined _
ENABLE
_AVX
avx_encode_double_array_2byte
(
datasize
,
lGrib
,
data
,
zref
,
factor
,
&
z
);
#elif defined __SSE4_1
__
#elif defined _
ENABLE
_SSE4_1
sse41_encode_double_array_2byte
(
datasize
,
lGrib
,
data
,
zref
,
factor
,
&
z
);
...
...
@@ -1444,15 +1451,12 @@ void encode_double_array_byte(int numBits, size_t packStart, size_t datasize,
#elif defined _GET_MACH_COUNTER
end_minmax
=
mach_absolute_time
();
#endif
#if defined __AVX__
printf
(
"AVX encoding cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#elif defined __SSE4_1__
printf
(
"SSE 4.1 encoding cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#if defined _ENABLE_AVX
printf
(
"AVX encoding cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#elif defined _ENABLE_SSE4_1
printf
(
"SSE 4.1 encoding cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#else
printf
(
"loop encoding cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
printf
(
"loop encoding cycles:: %"
PRIu64
"
\n
"
,
end_minmax
-
start_minmax
);
#endif
#endif
...
...
@@ -1759,6 +1763,10 @@ void encode_double_array_unrolled(int numBits, size_t packStart, size_t datasize
*
gz
=
z
;
#undef __UNROLL_DEPTH_2
}
#undef DISABLE_SIMD
#undef _ENABLE_AVX
#undef _ENABLE_SSE4_1
//#undef _GET_X86_COUNTER
//#undef _GET_MACH_COUNTER
//#undef _GET_IBM_COUNTER
...
...
@@ -1775,21 +1783,38 @@ void encode_double_array_unrolled(int numBits, size_t packStart, size_t datasize
#define __STDC_FORMAT_MACROS
#include
<inttypes.h>
/*
#if ((__GNUC__ >= 4) || (__ICC >= 1100) || defined (__clang__))
#define _ENABLE_SIMD
#include <immintrin.h>
#undef __AVX
#ifdef __AVX__
#define _ENABLE_AVX
#elif __SSE4_1__
#define _ENABLE_SSE4_1
#if defined(__GNUC__) && (__GNUC__ >= 4)
#elif defined(__ICC) && (__ICC >= 1100)
#elif defined(__clang__)
#else
#define DISABLE_SIMD
#endif
#define DISABLE_SIMD
#ifdef DISABLE_SIMD
# ifdef ENABLE_AVX
# define _ENABLE_AVX
# endif
# ifdef ENABLE_SSE4_1
# define _ENABLE_SSE4_1
# endif
#endif
*/
#undef _ENABLE_AVX
#undef _ENABLE_SSE4_1
#ifndef DISABLE_SIMD
# ifdef __AVX__
# define _ENABLE_AVX
# endif
# ifdef __SSE4_1__
# define _ENABLE_SSE4_1
# endif
#endif
#if defined _ENABLE_AVX
#include
<immintrin.h>
#elif defined _ENABLE_SSE4_1
#include
<smmintrin.h>
#endif
#if defined _ENABLE_AVX
...
...
@@ -2166,14 +2191,11 @@ void decode_double_array_byte(const unsigned char * restrict igrib, long jlend,
end_decode
=
mach_absolute_time
();
#endif
#if defined _ENABLE_AVX
printf
(
"AVX encoding cycles:: %"
PRIu64
"
\n
"
,
end_decode
-
start_decode
);
printf
(
"AVX encoding cycles:: %"
PRIu64
"
\n
"
,
end_decode
-
start_decode
);
#elif defined _ENABLE_SSE4_1
printf
(
"SSE 4.1 encoding cycles:: %"
PRIu64
"
\n
"
,
end_decode
-
start_decode
);
printf
(
"SSE 4.1 encoding cycles:: %"
PRIu64
"
\n
"
,
end_decode
-
start_decode
);
#else
printf
(
"loop encoding cycles:: %"
PRIu64
"
\n
"
,
end_decode
-
start_decode
);
printf
(
"loop encoding cycles:: %"
PRIu64
"
\n
"
,
end_decode
-
start_decode
);
#endif
#endif
...
...
@@ -2217,6 +2239,10 @@ void decode_double_array_unrolled(const unsigned char * restrict igrib, long jle
decode_double_array_byte
(
igrib
,
jlend
,
numBits
,
fmin
,
zscale
,
fpdata
);
}
#undef DISABLE_SIMD
#undef _ENABLE_AVX
#undef _ENABLE_SSE4_1
#define NINT(x) ((x) < 0 ? (int)((x)-.5) : (int)((x)+.5))
...
...
@@ -10578,7 +10604,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return
(
gribLen
);
}
static
const
char
grb_libvers
[]
=
"1.6.2"
" of ""Jul 1
0
2013"" ""1
8:44:40
"
;
static
const
char
grb_libvers
[]
=
"1.6.2"
" of ""Jul 1
1
2013"" ""1
1:16:39
"
;
const
char
*
cgribexLibraryVersion
(
void
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment