Open rageworx opened 1 year ago
homebrew llvm should be installed by brew install llvm
.
homebrew openmp should be installed by brew install libomp
.
Some makefiles created for testing openmp.
makefiles/Makefile.homebrewllvm
Makefiles/Makefile.testmachomebrew
Generating dylib successfully done, with makefiles/Makefile.homebrewllvm
with make dylib
.
homebrew llvm doesn't support multi-architecture, Cannot use multiple -arch
parameters for universal binary.
homebrew llvm dylib + macOS native llvm-gcc linking successfully worked.
Performance extremely increased for butterfly.png on my old MacBook Pro Ratina 13" (2015) CTO, Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz.
> bin/srcnntest Pictures/butterfly.png --scale=2
- Loading image : Pictures/butterfly.png
- Image loaded type : PNG | 256 x 256 x 3 bytes
- Scaling ratio : 2.00
- Filter : Bicubic
- Processing SRCNN ... Test Ok, took 799 ms.
- Saving rezied result to Pictures/butterfly_resized.png ... Ok.
- Saving convolution result to Pictures/butterfly_convolution.png ... Ok.
Testing performance with test.jpg,
> bin/srcnntest Pictures/test.jpg --scale=2
- Loading image : Pictures/test.jpg
- Image loaded type : JPEG | 960 x 540 x 3 bytes
- Scaling ratio : 2.00
- Filter : Bicubic
- Processing SRCNN ... Test Ok, took 5770 ms.
- Saving rezied result to Pictures/test_resized.png ... Ok.
- Saving convolution result to Pictures/test_convolution.png ... Ok.
libsrcnn-dylib-macOS12-intel-experimental.zip
> otool -L lib/libsrcnn.dylib
lib/libsrcnn.dylib:
lib/libsrcnn.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/llvm/lib/c++/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/llvm/lib/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
install_name_tool
to change dylib references if needed.
Default llvm (clang) of macOS not supports openmp basically. Experimental performance enhancement for Intel CPU based Mac systems.