File tree 4 files changed +22
-4
lines changed
4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ before_script:
25
25
- tar jxvf cantrbry.tar.bz2
26
26
- mkdir build
27
27
- cd build
28
- - cmake ..
28
+ - cmake .. -DUSE_SIMD=1
29
29
script :
30
30
- make
31
31
- ./TestRangeCoder
Original file line number Diff line number Diff line change @@ -56,5 +56,15 @@ An implementaion of adaptive range coder for C++
56
56
| sum| 0.491946| 88| 112|
57
57
| xargs.1| 0.628815| 13| 15|
58
58
59
+ # Building
60
+ For Visual Studio 15 2017,
61
+ ```
62
+ git clone https://github.com/taqu/cpprcoder.git
63
+ cd cpprcoder/test
64
+ mkdir build_simd
65
+ pushd build_simd
66
+ cmake -G"Visual Studio 15 2017 Win64" -DUSE_SIMD=1 ..
67
+ ```
68
+
59
69
# License
60
70
This is free and unencumbered software released into the public domain.
Original file line number Diff line number Diff line change @@ -117,7 +117,6 @@ namespace cpprcoder
117
117
#define CPPRCODER_USE_SSE2 (1 )
118
118
#endif
119
119
120
-
121
120
enum Status
122
121
{
123
122
Status_Success = 0 ,
@@ -684,6 +683,7 @@ namespace cpprcoder
684
683
frequencies_[i] = 1 ;
685
684
}
686
685
686
+ prefix_[0 ] = CHUNK_SIZE;
687
687
for (s32 i=1 ; i<CHUNKS; ++i){
688
688
prefix_[i] = prefix_[i-1 ] + CHUNK_SIZE;
689
689
}
Original file line number Diff line number Diff line change @@ -22,8 +22,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
22
22
23
23
add_executable (${ProjectName} ${FILES} )
24
24
25
+ set (CXX_FLAGS_SIMD "" )
25
26
if (MSVC )
26
- set (DEFAULT_CXX_FLAGS "/DWIN32 /D_WINDOWS /D_MBCS /W4 /WX- /nologo /fp:precise /arch:AVX /Zc:wchar_t /TP /Gd" )
27
+ if (USE_SIMD)
28
+ set (CXX_FLAGS_SIMD "/arch:AVX" )
29
+ endif ()
30
+
31
+ set (DEFAULT_CXX_FLAGS "/DWIN32 /D_WINDOWS /D_MBCS /W4 /WX- /nologo /fp:precise /Zc:wchar_t /TP /Gd ${CXX_FLAGS_SIMD} " )
27
32
if ("1800" VERSION_LESS MSVC_VERSION )
28
33
set (DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} /EHsc" )
29
34
endif ()
@@ -35,7 +40,10 @@ if(MSVC)
35
40
target_link_libraries (${ProjectName} "liblz4_static.lib" )
36
41
37
42
elseif (UNIX )
38
- set (DEFAULT_CXX_FLAGS "-Wall -O2 -std=c++11 -march=native" )
43
+ if (USE_SIMD)
44
+ set (CXX_FLAGS_SIMD "-march=native" )
45
+ endif ()
46
+ set (DEFAULT_CXX_FLAGS "-Wall -O2 -std=c++11 ${CXX_FLAGS_SIMD} " )
39
47
set (CMAKE_CXX_FLAGS "${DEFAULT_CXX_FLAGS} " )
40
48
target_link_libraries (${ProjectName} "z" )
41
49
elseif (APPLE )
You can’t perform that action at this time.
0 commit comments