claude
Fractal Bachius
Posts: 563
|
|
« on: March 05, 2017, 12:58:26 PM » |
|
I finally managed to cross-compile Kalles Fraktaler 2.9.3 with mingw64 on Linux (Debian Stretch). I uploaded a git repository with my modifications here: https://code.mathr.co.uk/kalles-fraktaler-2Unfortunately it's about 50% slower than the binary of 2.9.4 from the upstream site, at least in one benchmark (which was quite heavy on the reference computations, light on per-pixel iterations). EDIT I made a simple page about this project with downloads of binaries and sources, and compilation instrucctions, benchmarks, etc: https://mathr.co.uk/kf/kf.html
|
|
« Last Edit: April 06, 2017, 01:33:53 PM by claude, Reason: update topic title »
|
Logged
|
|
|
|
zebastian
|
|
« Reply #1 on: March 05, 2017, 02:05:59 PM » |
|
hi claude, well done! you may try to use -msse2 -ffast-math as additional cxx flags in the makefile: https://code.mathr.co.uk/kalles-fraktaler-2/blob/81653f04efbad9ff34f08d9af7dc721c55707cc5:/MakefileThese are more aggressive performance steps which will - take longer to compile - produce bigger binaries - make the binary bound to the CPU you are running on + But the runtime will be much better. When i am compiling Mandelbulber on my machine for rendering i use these flags to compile a "production" binary.
|
|
|
Logged
|
|
|
|
Kalles Fraktaler
|
|
« Reply #2 on: March 06, 2017, 12:37:44 AM » |
|
Excellent achievement claude! I guess the hardest point was the CFixedFloat class, in which I heavily relied on MSVC perhaps non-standard non-strict overloaded functions? I have some issues uploading the latest code, but will do as soon as the issues are solved
|
|
|
Logged
|
|
|
|
|
claude
Fractal Bachius
Posts: 563
|
|
« Reply #4 on: March 07, 2017, 08:14:27 PM » |
|
Major thanks for the updated code - lots of changes! But there is a small problem, the sources for the ldbl64.dll are out of date, 2014 in my file listing, and the resulting compiled dll is incompatible with the main program... Anyway, I've been hacking away, here's source: https://code.mathr.co.uk/kalles-fraktaler-2this branch tracks kalles source zips, no changes https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/masterthis branch makes kalles source compileable with mingw, plus some bug fixes https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/claude(the 2.11.1 zip commit is mislabeled as 2.9.3, oops) this branch allows building with GMP mpf_t or MPFR mpfr_t instead of custom code - in my benchmarks mpf_t is faster at deeper zooms (e1000 or so), plus less code to maintain https://code.mathr.co.uk/kalles-fraktaler-2/shortlog/refs/heads/claude-gmp(the 2.11.1 zip commit is mislabeled as 2.9.3, oops) no instructions yet on how to install GMP for usage by mingw, possibly mightymandel has some relevant docs; also the C++ bindings from boost::multiprecision are needed, that can just be unpacked and symlinked so that the C++ #include find the right files.. here are some binaries (64bit, tested in wine on linux): first version forked from 2.9.3, mostly working fine in my tests (just regular mandelbrot so far): https://mathr.co.uk/mandelbrot/kf-2.9.3%2Bgmp.20170307.ziphttps://mathr.co.uk/mandelbrot/kf-2.9.3%2Bgmp.20170307.zip.sigsecond version forked from 2.11.1, crashes if long double is needed (workaround is to menu -> special -> use floatexp always), not tested as much: https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170307.ziphttps://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170307.zip.sigboth binaries have corresponding tags in the git repository, so you can find out which sources were used some crude timing results: benchmarks upstream exes cross-mingw 2.9.3 fork additional notes 2.9.4 2.11.1 custom gmp mpfr zoom delta type evolution-of-trees.kfr 3:58.7 3:43.3 6:10.3 4:16.7 4:41.6 e227 double Ssssssssss.kfr 7.537 8.363 9.041 6.605 6.731 e533 scaled double e1000.kfr w/ dll 7.279 7.370 8.674 6.343 6.510 e1000 long double e1000.kfr w/o dll 7.752 7.905 fail 6.737 6.782 e1000 floatexp glitch33.kfr w/ dll 9.483 9.551 11.170 7.448 7.691 e1277 long double glitch33.kfr w/o dll 10.112 10.185 fail 7.982 8.033 e1277 floatexp
|
|
|
Logged
|
|
|
|
Kalles Fraktaler
|
|
« Reply #5 on: March 07, 2017, 08:48:52 PM » |
|
Thanks claude Yes you are right it was an old version, sorry for that. I have updated fractal_src_2.11.1.zip on the site, and if there is a cache problem, I uploaded it separately as well, http://www.chillheimer.de/kallesfraktaler/ldbl.cppWill your changes make it possible to compile the whole program in gcc now? If so, no need to put ldbl in a separate dll, because the reason for that is that I compile ldbl with gcc. Looks like some locations you tested are faster with gmp/mpfr!?
|
|
|
Logged
|
|
|
|
claude
Fractal Bachius
Posts: 563
|
|
« Reply #6 on: March 08, 2017, 05:10:27 PM » |
|
Thanks claude Yes you are right it was an old version, sorry for that. I have updated fractal_src_2.11.1.zip on the site, and if there is a cache problem, I uploaded it separately as well, http://www.chillheimer.de/kallesfraktaler/ldbl.cppWill your changes make it possible to compile the whole program in gcc now? If so, no need to put ldbl in a separate dll, because the reason for that is that I compile ldbl with gcc. Looks like some locations you tested are faster with gmp/mpfr!? Thanks for the code. Yes it can all be compiled with gcc now, so it could be merged without a separate dll. I haven't got Windows to test compiling there, but mingw/msys might be able to do it with appropriate changes to the Makefile. GMP and MPFR are faster at higher precisions, it seems.
|
|
|
Logged
|
|
|
|
quaz0r
Fractal Molossus
Posts: 652
|
|
« Reply #7 on: March 08, 2017, 05:24:35 PM » |
|
gmp/mpfr is explicitly vectorized, which shows the most noticeable performance boost with larger mantissas
|
|
|
Logged
|
|
|
|
claude
Fractal Bachius
Posts: 563
|
|
« Reply #8 on: March 13, 2017, 05:24:05 AM » |
|
some small changes in my claude-gmp branch: * fixed the crash at long double (which turned out to be a stack overflow) by increasing stack size to 64MB (from 32MB) * long double code updated to kalles upstream * compiled into one exe, no need for separate dll for long double any more * no -msse2 (should be enabled by default on x86_64/amd64 anyway) * no -march=native (not suitable for distributing binaries) * does use -ffast-math, though I didn't benchmark its effect fresh binary: https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.ziphttps://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.zip.sigadditional benchmarks: * Newton-Raphson zooming is significantly faster with GMP: zooming into center pixel of glitch33.kfr (e1277) calculates new location in 18 seconds as opposed to over 4 minutes with kf-2.11.1 * rendering is significantly faster with GMP at deep enough zooms: Dinkydau's hyperbolic tiling pistil location (e2293, 640x360) takes 3 hours with upstream kf-2.11.1, with GMP it takes 1 hour 18 minutes, plus an additional 10 minutes if compiled to use MPFR instead of GMP. EDITED to add: there are some warnings that are concerning with respect to 64bit safety - it seems to work, but chances are some address space layout changes could make it explode? I don't know what Microsoft Windows guarantees, but there exist functions like SetClassLongPtr which should be used instead of SetClassLong for pointers (which are 64bit on 64bit...). Here's the warning dump: fraktal_sft/listbox.cpp: In function ‘int SubclassListProc(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/listbox.cpp:14:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/listbox.cpp:19:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/listbox.cpp:24:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/listbox.cpp:28:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam); ^ fraktal_sft/listbox.cpp: In constructor ‘CListBox::CListBox(HWND, HWND, char*, int, COLORREF, COLORREF, BOOL)’: fraktal_sft/listbox.cpp:108:44: warning: cast from ‘CListBox*’ to ‘LONG {aka long int}’ loses precision [-fpermissive] SetWindowLong(m_hwList,GWL_USERDATA,(LONG)this); ^~~~ fraktal_sft/listbox.cpp:109:43: warning: cast from ‘int (*)(HWND, UINT, WPARAM, LPARAM) {aka int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive] SetWindowLong(m_hwList,GWL_WNDPROC,(LONG)SubclassListProc); ^~~~~~~~~~~~~~~~ fraktal_sft/listbox.cpp: In constructor ‘CListBoxEdit::CListBoxEdit(HWND, HWND, HWND, HWND, HWND, HWND__**, int)’: fraktal_sft/listbox.cpp:250:35: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] m_stEdits.AddInt((int)phwEdits[i]); ^ fraktal_sft/listbox.cpp: In member function ‘int CListBoxEdit::ProcessMessage(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/listbox.cpp:259:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1; ^ fraktal_sft/listbox.cpp:265:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass)); ^ fraktal_sft/listbox.cpp:267:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10); ^ fraktal_sft/listbox.cpp:269:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1); ^ fraktal_sft/listbox.cpp:284:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1; ^ fraktal_sft/listbox.cpp:290:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass)); ^ fraktal_sft/listbox.cpp:292:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10); ^ fraktal_sft/listbox.cpp:294:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1); ^ fraktal_sft/listbox.cpp:322:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass)); ^ fraktal_sft/listbox.cpp:324:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] SendMessage((HWND)atoi(m_stEdits[i]),BM_SETCHECK,atoi(stT[0][i+1]),0); ^ fraktal_sft/listbox.cpp:326:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] SetWindowTextA((HWND)atoi(m_stEdits[i]),stT[0][i+1]); ^ fraktal_sft/main.cpp: In function ‘long int ShowProc(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/main.cpp:754:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,lParam,wParam); ^ fraktal_sft/main.cpp: In function ‘int CustomZoomSize(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/main.cpp:3157:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] char *szTmp = (char*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/main.cpp: In function ‘int SkewProc(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/main.cpp:3455:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/main.cpp:3666:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA); ^ common/FolderBrowser.cpp: In function ‘int lpfnEdit(HWND, UINT, WPARAM, LPARAM)’: common/FolderBrowser.cpp:66:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam); ^ common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int)’: common/FolderBrowser.cpp:102:40: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive] int nRet = (int)SHBrowseForFolderA(&bi); ^ common/FolderBrowser.cpp: In function ‘long int FilterProc(HWND, UINT, WPARAM, LPARAM)’: common/FolderBrowser.cpp:114:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam); ^ common/FolderBrowser.cpp: In function ‘int lpfnCallBack2(HWND, UINT, WPARAM, LPARAM)’: common/FolderBrowser.cpp:132:41: warning: cast from ‘long int (*)(HWND, UINT, WPARAM, LPARAM) {aka long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive] SetWindowLong(hEdit,GWL_WNDPROC,(LONG)FilterProc); ^~~~~~~~~~ common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int, char*, char*, int)’: common/FolderBrowser.cpp:160:39: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive] int nRet = (int)SHBrowseForFolder(&bi); ^ common/StringVector.cpp: In member function ‘char* CStringVektor::GetString(int, int*)’: common/StringVector.cpp:439:29: warning: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] return m_pszStrings[nIndex]?m_pszStrings[nIndex]:""; ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ common/tooltip.cpp: In function ‘long int ToolTipProc(HWND, UINT, WPARAM, LPARAM)’: common/tooltip.cpp:153:28: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] wsprintf(szTmp,"%d",(int)hw); ^~ common/tooltip.cpp: In function ‘void CollectObjects(HWND, HWND, LPARAM)’: common/tooltip.cpp:226:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwNext); ^~~~~~ common/tooltip.cpp:227:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwParent); ^~~~~~~~ common/tooltip.cpp: In function ‘void ExitToolTip(HWND)’: common/tooltip.cpp:283:36: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] if(atoi(g_stWindows[i][1])==(int)hWnd) ^~~~
|
|
« Last Edit: March 13, 2017, 06:57:11 AM by claude, Reason: warnings »
|
Logged
|
|
|
|
Dinkydau
|
|
« Reply #9 on: March 14, 2017, 02:06:11 AM » |
|
Thanks for these great speedups. This will be useful.
I just noticed the coordinates are written in scientific notation. I assume that's something unintentional?
|
|
|
Logged
|
|
|
|
claude
Fractal Bachius
Posts: 563
|
|
« Reply #10 on: March 14, 2017, 03:22:30 PM » |
|
I just noticed the coordinates are written in scientific notation. I assume that's something unintentional?
Yes unintentional, just using the default string format of the underlying libraries - I'll see if it's an easy fix, but I don't think it will cause many problems?
|
|
|
Logged
|
|
|
|
Kalles Fraktaler
|
|
« Reply #11 on: March 14, 2017, 05:04:46 PM » |
|
some small changes in my claude-gmp branch: * fixed the crash at long double (which turned out to be a stack overflow) by increasing stack size to 64MB (from 32MB) * long double code updated to kalles upstream * compiled into one exe, no need for separate dll for long double any more * no -msse2 (should be enabled by default on x86_64/amd64 anyway) * no -march=native (not suitable for distributing binaries) * does use -ffast-math, though I didn't benchmark its effect fresh binary: https://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.ziphttps://mathr.co.uk/mandelbrot/kf-2.11.1%2Bgmp.20170313.zip.sigadditional benchmarks: * Newton-Raphson zooming is significantly faster with GMP: zooming into center pixel of glitch33.kfr (e1277) calculates new location in 18 seconds as opposed to over 4 minutes with kf-2.11.1 * rendering is significantly faster with GMP at deep enough zooms: Dinkydau's hyperbolic tiling pistil location (e2293, 640x360) takes 3 hours with upstream kf-2.11.1, with GMP it takes 1 hour 18 minutes, plus an additional 10 minutes if compiled to use MPFR instead of GMP. EDITED to add: there are some warnings that are concerning with respect to 64bit safety - it seems to work, but chances are some address space layout changes could make it explode? I don't know what Microsoft Windows guarantees, but there exist functions like SetClassLongPtr which should be used instead of SetClassLong for pointers (which are 64bit on 64bit...). Here's the warning dump: fraktal_sft/listbox.cpp: In function ‘int SubclassListProc(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/listbox.cpp:14:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/listbox.cpp:19:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/listbox.cpp:24:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CListBox*pList = (CListBox*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/listbox.cpp:28:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam); ^ fraktal_sft/listbox.cpp: In constructor ‘CListBox::CListBox(HWND, HWND, char*, int, COLORREF, COLORREF, BOOL)’: fraktal_sft/listbox.cpp:108:44: warning: cast from ‘CListBox*’ to ‘LONG {aka long int}’ loses precision [-fpermissive] SetWindowLong(m_hwList,GWL_USERDATA,(LONG)this); ^~~~ fraktal_sft/listbox.cpp:109:43: warning: cast from ‘int (*)(HWND, UINT, WPARAM, LPARAM) {aka int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive] SetWindowLong(m_hwList,GWL_WNDPROC,(LONG)SubclassListProc); ^~~~~~~~~~~~~~~~ fraktal_sft/listbox.cpp: In constructor ‘CListBoxEdit::CListBoxEdit(HWND, HWND, HWND, HWND, HWND, HWND__**, int)’: fraktal_sft/listbox.cpp:250:35: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] m_stEdits.AddInt((int)phwEdits[i]); ^ fraktal_sft/listbox.cpp: In member function ‘int CListBoxEdit::ProcessMessage(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/listbox.cpp:259:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1; ^ fraktal_sft/listbox.cpp:265:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass)); ^ fraktal_sft/listbox.cpp:267:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10); ^ fraktal_sft/listbox.cpp:269:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1); ^ fraktal_sft/listbox.cpp:284:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] nLen+=GetWindowTextLength((HWND)atoi(m_stEdits[i]))+1; ^ fraktal_sft/listbox.cpp:290:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass)); ^ fraktal_sft/listbox.cpp:292:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] itoa(SendMessage((HWND)atoi(m_stEdits[i]),BM_GETCHECK,0,0),szTmp+strlen(szTmp),10); ^ fraktal_sft/listbox.cpp:294:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetWindowTextA((HWND)atoi(m_stEdits[i]),szTmp+strlen(szTmp),nLen+1); ^ fraktal_sft/listbox.cpp:322:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] GetClassName((HWND)atoi(m_stEdits[i]),szClass,sizeof(szClass)); ^ fraktal_sft/listbox.cpp:324:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] SendMessage((HWND)atoi(m_stEdits[i]),BM_SETCHECK,atoi(stT[0][i+1]),0); ^ fraktal_sft/listbox.cpp:326:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] SetWindowTextA((HWND)atoi(m_stEdits[i]),stT[0][i+1]); ^ fraktal_sft/main.cpp: In function ‘long int ShowProc(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/main.cpp:754:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,lParam,wParam); ^ fraktal_sft/main.cpp: In function ‘int CustomZoomSize(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/main.cpp:3157:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] char *szTmp = (char*)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/main.cpp: In function ‘int SkewProc(HWND, UINT, WPARAM, LPARAM)’: fraktal_sft/main.cpp:3455:57: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA); ^ fraktal_sft/main.cpp:3666:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] HWND hwParent = (HWND)GetWindowLong(hWnd,GWL_USERDATA); ^ common/FolderBrowser.cpp: In function ‘int lpfnEdit(HWND, UINT, WPARAM, LPARAM)’: common/FolderBrowser.cpp:66:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam); ^ common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int)’: common/FolderBrowser.cpp:102:40: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive] int nRet = (int)SHBrowseForFolderA(&bi); ^ common/FolderBrowser.cpp: In function ‘long int FilterProc(HWND, UINT, WPARAM, LPARAM)’: common/FolderBrowser.cpp:114:62: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return CallWindowProc((WNDPROC)GetClassLong(hWnd,GCL_WNDPROC),hWnd,uMsg,wParam,lParam); ^ common/FolderBrowser.cpp: In function ‘int lpfnCallBack2(HWND, UINT, WPARAM, LPARAM)’: common/FolderBrowser.cpp:132:41: warning: cast from ‘long int (*)(HWND, UINT, WPARAM, LPARAM) {aka long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}’ to ‘LONG {aka long int}’ loses precision [-fpermissive] SetWindowLong(hEdit,GWL_WNDPROC,(LONG)FilterProc); ^~~~~~~~~~ common/FolderBrowser.cpp: In function ‘int Browse(HWND, char*, int, char*, char*, int)’: common/FolderBrowser.cpp:160:39: warning: cast from ‘LPITEMIDLIST {aka _ITEMIDLIST*}’ to ‘int’ loses precision [-fpermissive] int nRet = (int)SHBrowseForFolder(&bi); ^ common/StringVector.cpp: In member function ‘char* CStringVektor::GetString(int, int*)’: common/StringVector.cpp:439:29: warning: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] return m_pszStrings[nIndex]?m_pszStrings[nIndex]:""; ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ common/tooltip.cpp: In function ‘long int ToolTipProc(HWND, UINT, WPARAM, LPARAM)’: common/tooltip.cpp:153:28: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] wsprintf(szTmp,"%d",(int)hw); ^~ common/tooltip.cpp: In function ‘void CollectObjects(HWND, HWND, LPARAM)’: common/tooltip.cpp:226:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwNext); ^~~~~~ common/tooltip.cpp:227:52: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] g_stWindows.AddInt(g_stWindows.GetCount()-1,(int)hwParent); ^~~~~~~~ common/tooltip.cpp: In function ‘void ExitToolTip(HWND)’: common/tooltip.cpp:283:36: warning: cast from ‘HWND {aka HWND__*}’ to ‘int’ loses precision [-fpermissive] if(atoi(g_stWindows[i][1])==(int)hWnd) ^~~~
Very cool indeed, thanks a lot. I don't recall these warnings occur when compiling in VS. What is the difference between MPFR and GMP? GMP seems preferable if it is faster
|
|
|
Logged
|
|
|
|
claude
Fractal Bachius
Posts: 563
|
|
« Reply #12 on: March 14, 2017, 06:55:19 PM » |
|
What is the difference between MPFR and GMP? GMP seems preferable if it is faster MPFR is correctly-rounded to the desired precision, supports infinity and NaN, and has many special functions (trigonometry etc). GMP's mpf_t floating point is quick and dirty, with only bare minimum of operations and only approximate precision.
|
|
|
Logged
|
|
|
|
Kalles Fraktaler
|
|
« Reply #13 on: March 16, 2017, 12:55:11 PM » |
|
It seems the reference is calculated faster in KF CFixedFloat class up to e300, then GMP is faster, and there is a very big difference at e10000. Perhaps GMP are using other method than simple school-book multiplication on high precision?
|
|
|
Logged
|
|
|
|
|
|