mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Factoring

Reply
 
Thread Tools
Old 2015-09-08, 23:39   #1
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default gcc optimization/intrinsics

Does anyone have experience with the SSE and other intrinsics?

As soon as I try turn turn on any kind of optimization in my ming64 installation
the compiler pulls in a lot of builtins/intrinsics, (as include files) and then
it starts spitting out many dozens of errrors in the intrinsic.h files

Am I failing to turn on some necessary compiler switches?

to wit:

gauss.c:4551:1: warning: AVX512F vector return without AVX512F enabled changes the ABI [-Wpsabi]
In file included from c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/x86intrin.h:31:0,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:1521,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:163,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windef.h:8,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windows.h:69,
from cputim.h:57,
from gauss.c:35:
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_mm_prefetch':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:58:3: error: second argument to '__builtin_prefetch' must be a constant
__builtin_prefetch (__P, (__I & 0x4) >> 2, __I & 0x3);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:58:3: error: third argument to '__builtin_prefetch' must be a constant
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_mm_shuffle_ps':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:747:10: error: the last argument must be an 8-bit immediate
return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_mm_extract_pi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1023:10: error: selector must be an integer constant in the range 0..3
return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_m_pextrw':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1023:10: error: selector must be an integer constant in the range 0..3
return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_mm_insert_pi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1044:18: error: selector must be an integer constant in the range 0..3
return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_m_pinsrw':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1044:18: error: selector must be an integer constant in the range 0..3
return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_mm_shuffle_pi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1145:18: error: the last argument must be an 8-bit immediate
return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h: In function '_m_pshufw':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1145:18: error: the last argument must be an 8-bit immediate
return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N);
^
In file included from c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1257:0,
from c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/x86intrin.h:31,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:1521,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:163,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windef.h:8,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windows.h:69,
from cputim.h:57,
from gauss.c:35:
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_shuffle_pd':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:906:10: error: the last argument must be a 2-bit immediate
return (__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, __mask);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_bsrli_si128':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1182:10: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_bslli_si128':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1188:10: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_srli_si128':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1182:10: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_slli_si128':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1188:10: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_extract_epi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1349:27: error: selector must be an integer constant in the range 0..7
return (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_insert_epi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1355:20: error: selector must be an integer constant in the range 0..7
return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_shufflehi_epi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1405:19: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __mask);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_shufflelo_epi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1411:19: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __mask);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h: In function '_mm_shuffle_epi32':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1417:19: error: the last argument must be an 8-bit immediate
return (__m128i)__builtin_ia32_pshufd ((__v4si)__A, __mask);
^
In file included from c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/x86intrin.h:37:0,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:1521,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:163,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windef.h:8,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windows.h:69,
from cputim.h:57,
from gauss.c:35:
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h: In function '_mm_alignr_epi8':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h:187:10: error: the last argument must be an 8-bit immediate
return (__m128i) __builtin_ia32_palignr128 ((__v2di)__X,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h: In function '_mm_alignr_pi8':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h:194:18: error: the last argument must be an 8-bit immediate
return (__m64) __builtin_ia32_palignr ((__v1di)__X,
^
In file included from c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/x86intrin.h:39:0,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:1521,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:163,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windef.h:8,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windows.h:69,
from cputim.h:57,
from gauss.c:35:
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h: In function '_mm_extracti_si64':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h:61:10: error: the next to last argument must be an 8-bit immediate
return (__m128i) __builtin_ia32_extrqi ((__v2di) __X, __I, __L);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h: In function '_mm_inserti_si64':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h:79:10: error: the next to last argument must be an 8-bit immediate
return (__m128i) __builtin_ia32_insertqi ((__v2di)__X, (__v2di)__Y, __I, __L);
^
In file included from c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/x86intrin.h:41:0,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:1521,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:163,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windef.h:8,
from c:/TDM-GCC-64/x86_64-w64-mingw32/include/windows.h:69,
from cputim.h:57,
from gauss.c:35:
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_round_pd':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:102:10: error: the last argument must be a 4-bit immediate
return (__m128d) __builtin_ia32_roundpd ((__v2df)__V, __M);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_round_sd':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:108:10: error: the last argument must be a 4-bit immediate
return (__m128d) __builtin_ia32_roundsd ((__v2df)__D,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_round_ps':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:127:10: error: the last argument must be a 4-bit immediate
return (__m128) __builtin_ia32_roundps ((__v4sf)__V, __M);
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_round_ss':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:133:10: error: the last argument must be a 4-bit immediate
return (__m128) __builtin_ia32_roundss ((__v4sf)__D,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_blend_epi16':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:168:20: error: the last argument must be an 8-bit immediate
return (__m128i) __builtin_ia32_pblendw128 ((__v8hi)__X,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_blend_ps':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:193:10: error: the last argument must be a 4-bit immediate
return (__m128) __builtin_ia32_blendps ((__v4sf)__X,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_blend_pd':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:218:10: error: the last argument must be a 2-bit immediate
return (__m128d) __builtin_ia32_blendpd ((__v2df)__X,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_dp_ps':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:243:10: error: the last argument must be an 8-bit immediate
return (__m128) __builtin_ia32_dpps ((__v4sf)__X,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_dp_pd':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:251:10: error: the last argument must be an 8-bit immediate
return (__m128d) __builtin_ia32_dppd ((__v2df)__X,
^
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h: In function '_mm_insert_ps':
c:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:348:10: error: the last argument must be an 8-bit immediate
return (__m128) __builtin_ia32_insertps128 ((__v4sf)__D,

Last fiddled with by R.D. Silverman on 2015-09-08 at 23:39
R.D. Silverman is offline   Reply With Quote
Old 2015-09-09, 00:59   #2
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3×1,181 Posts
Default

Compiling with -march=native will turn on the intrinsics that your machine supports and turn off the ones that it does not.

Is it possible that the code using those intrinsics is relying on #define'd constants that have not been defined?
jasonp is offline   Reply With Quote
Old 2015-09-09, 11:50   #3
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by jasonp View Post
Compiling with -march=native will turn on the intrinsics that your machine supports and turn off the ones that it does not.

Is it possible that the code using those intrinsics is relying on #define'd constants that have not been defined?
Possible, yes.

Note that the compiler is failing when trying to compile the intrinsics themselves.
R.D. Silverman is offline   Reply With Quote
Old 2015-09-09, 18:56   #4
TheJudger
 
TheJudger's Avatar
 
"Oliver"
Mar 2005
Germany

111110 Posts
Default

AVX512?
Just a guess: try '-mno-avx512f', perhaps the AVX512 stuff is the issue (note: no current available CPU supports AVX512)
TheJudger is offline   Reply With Quote
Old 2015-09-09, 19:02   #5
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by TheJudger View Post
AVX512?
Just a guess: try '-mno-avx512f', perhaps the AVX512 stuff is the issue (note: no current available CPU supports AVX512)
Thanks. I will try it.
R.D. Silverman is offline   Reply With Quote
Old 2015-09-13, 15:34   #6
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Thanks. I will try it.
I have tried -march=native. I have tried -noavx-512x, I have tried -fno-builtin.
The results are the same. Hundreds of errors compiling the builtins.

Strangely, If I turn off in-lining with -O0, everything compiles fine.

I have working code. It is single threaded. unoptimized (I have not yet build the multi-threaded code)
It is taking 330 hours to deal with a matrix with 7.3M rows ----->> slow! slow! slow!

I am clueless here. I can't get the code to compile as -Os (small) -Ofast, -O1, -O2, -O3.

I do not know what else to do. Advice, please?
R.D. Silverman is offline   Reply With Quote
Old 2015-09-13, 17:00   #7
ldesnogu
 
ldesnogu's Avatar
 
Jan 2008
France

55010 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I have tried -march=native. I have tried -noavx-512x, I have tried -fno-builtin.
The results are the same. Hundreds of errors compiling the builtins.

Strangely, If I turn off in-lining with -O0, everything compiles fine.

I have working code. It is single threaded. unoptimized (I have not yet build the multi-threaded code)
It is taking 330 hours to deal with a matrix with 7.3M rows ----->> slow! slow! slow!

I am clueless here. I can't get the code to compile as -Os (small) -Ofast, -O1, -O2, -O3.

I do not know what else to do. Advice, please?
Given that cputim.h includes the offending file, you could try to force the use of one of the two other variants of CPUTIM in that file, the CRAY variant is the most likely to work for you.
ldesnogu is offline   Reply With Quote
Old 2015-09-13, 17:18   #8
TheJudger
 
TheJudger's Avatar
 
"Oliver"
Mar 2005
Germany

11·101 Posts
Default

The reason why it compiles without optimization is likely stuff like this in include/*intrin.h:
Code:
#ifdef __OPTIMIZE__
While I don't use mingw this is basically yet another gcc port. The are comments on the www that they needed to change
Code:
extern [...]
to
Code:
extern "C" [...]
in the include/*intrin.h files... but I won't feel comfortable with this!

Another shoot into the dark: Include intrin.h instead of xmmintrin.h.

Oliver
TheJudger is offline   Reply With Quote
Old 2015-09-13, 18:30   #9
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by ldesnogu View Post
Given that cputim.h includes the offending file, you could try to force the use of one of the two other variants of CPUTIM in that file, the CRAY variant is the most likely to work for you.
I've been thinking about just turning off the timing code.
R.D. Silverman is offline   Reply With Quote
Old 2015-09-13, 18:55   #10
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
I've been thinking about just turning off the timing code.
Strangely enough, VS compiles cputim.h without problem, even with optimization turned
off. It is the inline intrinsics pulled in from windows.h that are disliked by gcc...

I might even just replace getrusage with a windows version.
R.D. Silverman is offline   Reply With Quote
Old 2015-09-13, 19:01   #11
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22·5·373 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
Strangely enough, VS compiles cputim.h without problem, even with optimization turned
off. It is the inline intrinsics pulled in from windows.h that are disliked by gcc...

I might even just replace getrusage with a windows version.
Strangely enough windows has an equivalent to getrusage called GetProcessTimes,
but instead of using it, CWO makes calls I have never seen before, to wit:


/* File cputim.h */
#ifndef CPUTIM_H
#define CPUTIM_H

#include "rcsid.h"
GENERATE_RCSID(cputim_rcsid,
"$Id: cputim.h,v 1.7 2003-10-28 16:17:07 pmontgom Exp $");
/*
CPUTIM() computers the amount of CPU times used so far
(user and system), as a double precision value.

A multitasked program should call CPUTIM_ALL
(see #include file parallel.h).

Depending upon the architecture and operating system,
it may or may not include times for spawned
processes (whether terminated or now running),
such as when calling zcat to uncompress an input file.
*/

#include "archtype.h"
#include "nfstypes.h"

#if OS_UNIX
#if ARCH_CRAY
#include <time.h>
static double CPUTIM(NOARGS)
{
return to_double(clock()) / to_double(CLOCKS_PER_SEC);
}
#else /* OS_UNIX but not ARCH_CRAY */

#include <sys/time.h>
#include <sys/resource.h>


static double CPUTIM(NOARGS)
{
/* Avoid clock() on SUN3 - goes only 35 minutes */
long sec, usec;
struct rusage inf;

getrusage(RUSAGE_SELF, &inf);
sec = inf.ru_utime.tv_sec + inf.ru_stime.tv_sec;
usec = inf.ru_utime.tv_usec + inf.ru_stime.tv_usec;
getrusage(RUSAGE_CHILDREN, &inf);
sec += inf.ru_utime.tv_sec + inf.ru_stime.tv_sec;
usec += inf.ru_utime.tv_usec + inf.ru_stime.tv_usec;
return to_double(sec) + 1.0e-6*to_double(usec);
}

#endif /* UNIX variants */

#endif /* OS_UNIX */

#if OS_WINDOWS
#include <windows.h>

static double CPUTIM(void)
{
static double tfreqd = 0.0;
static LARGE_INTEGER tbegin;
LARGE_INTEGER t1;
if (tfreqd == 0.0) {
QueryPerformanceFrequency(&t1);
QueryPerformanceCounter(&tbegin);
tfreqd = 1.0/to_double(t1.QuadPart); /* Clock resolution, seconds */
}
QueryPerformanceCounter(&t1);
return tfreqd*to_double(t1.QuadPart - tbegin.QuadPart);
} /* end CPUTIM */

#endif /* OS_WINDOWS */

#endif /* CPUTIM_H */

I have never seen these "QueryPerformance" calls before.
R.D. Silverman is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program optimization henryzz Programming 17 2012-09-26 13:21
Possible optimization for GIMPS alpertron Math 3 2012-08-13 16:08
Size optimization Sleepy Msieve 14 2011-10-20 10:27
NFS Optimization R.D. Silverman Factoring 91 2010-01-24 20:48
ASM Optimization Cyclamen Persicum Hardware 4 2004-05-26 07:51

All times are UTC. The time now is 17:24.


Fri Sep 24 17:24:06 UTC 2021 up 63 days, 11:53, 2 users, load averages: 1.78, 1.78, 1.65

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.