GeezerVison is showing github.com — mingw gcc msvc compilation · Issue #203 · tiny-dnn/tiny-dnn
mingw gcc msvc compilation #203
Description
I'm getting trouble using tiny-cnn with mingw or gcc.
For mingw, I need to change the free by _mm_free in align_allocator.h file unless I get unexpected crash.
#elif defined(__MINGW32__)
- ::free(ptr);
+ ::_mm_free(ptr);
With this path I'm able to use tiny-cnn with mingw under windows.
But, I've run some benchmarks. I have compiled the same code based on /examples.main.cpp and tried it with
- windows 7 + mingw 32 bits (-O3)
- windows 7 + mingw 64 bits (-O3)
- debian + gcc 5 (-O3)
- windows 7 + MSVC 2015 (/O2)
For the 3 first versions, my bench runs in around 1300 s while the MSVC version runs in 80s!!
The differences in the code are small (only in this align_allocator). I also tried replacing the align allocation by simple malloc (for all versions) and got similar results.
Unfortunately, I can't use msvc on this.
Do you have any hints ? A compile option ?
Do you encounter the same issue ?
Thanks for your support
Activity
nyanp commented on Jun 27, 2016
@pebz
Hi,
For the 3 first versions, my bench runs in around 1300 s while the MSVC version runs in 80s!!
1300s is too slow... It seems that some compile options for optimization isn't defined. If you built tiny-cnn with CMake, could you show me gcc's compile options generated by CMake? (you can use make VERBOSE=1 to see options)
pebz commented on Jun 27, 2016
Hi nyanp,
Thanks for your answer.
I didn't use CMake.
I compile it directly:
mingw/gcc: g++ -std=c++11 -I ../ -O3 main.cpp -o tiny-cnn-gcc
msvc: cl -I../ /O2 main.cpp -o tiny-cnn-msvc
(I also tried to add AVX SSE options without any result)
Should I use CMake ?
What kind of options should I add ?
nyanp commented on Jun 27, 2016
@pebz
Thanks :) Adding -DCNN_USE_AVX with -mavx option will work.
Randl commented on Feb 14, 2017
@pebz can you confirm latest version works for you?
Randl commented on Mar 7, 2017
Closing. @pebz if you have any issues feel free to reopen or open a new issue
Metadata
Metadata
Development
No branches or pull requestsIssue actions