Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
6,737 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.idea/ | ||
|
||
build/ | ||
cmake-build-debug/ | ||
data/ | ||
other/fsss2.cpp | ||
other/fsss2.h | ||
other/t_128.cpp | ||
other/t_128.h | ||
other/JCZSolve.c | ||
other/JCZSolve.h | ||
other/JSolve.c | ||
other/JSolve.h | ||
src/build_info.h | ||
|
||
run_benchmark | ||
run_tests | ||
libtdoku.a | ||
Makefile | ||
cmake_install.cmake | ||
CMakeCache.txt | ||
CMakeFiles/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p build | ||
cd build | ||
rm -f CMakeCache.txt | ||
rm -rf CMakeFiles | ||
cmake .. $* | ||
make | ||
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(tdoku VERSION 1.0) | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
option(OPT "Compile with full optimization" ON) | ||
option(SSE4_1 "Compile with SSE4.1 support" ON) | ||
option(AVX2 "Compile with AVX2 support" OFF) | ||
option(AVX512 "Compile with AVX512BITALG support" OFF) | ||
option(NATIVE "Compile for native architecture" OFF) | ||
|
||
option(FSSS2 "Include fsss2" OFF) | ||
option(JCZSOLVE "Include JCZSolve" OFF) | ||
option(JSOLVE "Include JSolve" OFF) | ||
option(MINISAT "Include MiniSat" OFF) | ||
|
||
if (OPT) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") | ||
else() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0") | ||
endif() | ||
|
||
if (NATIVE) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") | ||
elseif (AVX512) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512vl -mavx512bitalg") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512vl -mavx512bitalg") | ||
elseif (AVX2) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") | ||
elseif (SSE4_1) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") | ||
else() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") | ||
endif() | ||
|
||
configure_file ( | ||
"${CMAKE_SOURCE_DIR}/src/build_info.h.in" | ||
"${CMAKE_SOURCE_DIR}/src/build_info.h" | ||
) | ||
|
||
# a gcc-linkable library with just the fast solver | ||
add_library(tdoku STATIC src/solver_dpll_triad_simd.cc) | ||
target_compile_options(tdoku PUBLIC -fno-exceptions -fno-rtti) | ||
|
||
set(BENCHMARK_SOLVER_SOURCES | ||
src/solver_basic.cc | ||
src/solver_dpll_triad_scc.cc | ||
src/solver_dpll_triad_simd.cc | ||
src/other_solvers.cc) | ||
|
||
if (FSSS2) | ||
add_definitions(-DFSSS2) | ||
set(BENCHMARK_SOLVER_SOURCES ${BENCHMARK_SOLVER_SOURCES} other/fsss2.cpp other/t_128.cpp) | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register") | ||
endif() | ||
|
||
if (JCZSOLVE) | ||
add_definitions(-DJCZSOLVE) | ||
set(BENCHMARK_SOLVER_SOURCES ${BENCHMARK_SOLVER_SOURCES} other/JCZSolve.c) | ||
endif() | ||
|
||
if (JSOLVE) | ||
add_definitions(-DJSOLVE) | ||
set(BENCHMARK_SOLVER_SOURCES ${BENCHMARK_SOLVER_SOURCES} other/JSolve.c) | ||
endif() | ||
|
||
if (MINISAT) | ||
add_definitions(-DMINISAT) | ||
set(BENCHMARK_SOLVER_SOURCES ${BENCHMARK_SOLVER_SOURCES} src/solver_minisat.cc) | ||
endif() | ||
|
||
add_executable(run_benchmark src/run_benchmark.cc ${BENCHMARK_SOLVER_SOURCES}) | ||
if (MINISAT) | ||
target_link_libraries(run_benchmark minisat) | ||
endif() | ||
|
||
add_executable(run_tests src/run_tests.cc ${BENCHMARK_SOLVER_SOURCES}) | ||
if (MINISAT) | ||
target_link_libraries(run_tests minisat) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
TDOKU: A Sudoku Solver | ||
|
||
See https://t-dillon.github.io/tdoku for the why and how. | ||
|
||
To run benchmarks: | ||
|
||
unzip data.zip | ||
./BUILD.sh | ||
./build/run_benchmark data/* |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
# the columns arg is necessary to get the tables to format to the same width. | ||
pandoc -o index.html -c pandoc.css --columns=50 --mathjax sudoku.md |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* jquery.tocify.css 1.9.1 | ||
* Author: @gregfranko | ||
*/ | ||
|
||
/* The Table of Contents container element */ | ||
.tocify { | ||
width: 20%; | ||
max-height: 90%; | ||
overflow: auto; | ||
margin-left: 2%; | ||
position: fixed; | ||
border: 1px solid #ccc; | ||
webkit-border-radius: 6px; | ||
moz-border-radius: 6px; | ||
border-radius: 6px; | ||
} | ||
|
||
/* The Table of Contents is composed of multiple nested unordered lists. These styles remove the default styling of an unordered list because it is ugly. */ | ||
.tocify ul, .tocify li { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
border: none; | ||
line-height: 30px; | ||
} | ||
|
||
/* Top level header elements */ | ||
.tocify-header { | ||
text-indent: 10px; | ||
} | ||
|
||
/* Top level subheader elements. These are the first nested items underneath a header element. */ | ||
.tocify-subheader { | ||
text-indent: 20px; | ||
display: none; | ||
} | ||
|
||
/* Makes the font smaller for all subheader elements. */ | ||
.tocify-subheader li { | ||
font-size: 12px; | ||
} | ||
|
||
/* Further indents second level subheader elements. */ | ||
.tocify-subheader .tocify-subheader { | ||
text-indent: 30px; | ||
} | ||
|
||
/* Further indents third level subheader elements. You can continue this pattern if you have more nested elements. */ | ||
.tocify-subheader .tocify-subheader .tocify-subheader { | ||
text-indent: 40px; | ||
} | ||
|
||
/* Twitter Bootstrap Override Style */ | ||
.tocify .tocify-item > a, .tocify .nav-list .nav-header { | ||
margin: 0px; | ||
} | ||
|
||
/* Twitter Bootstrap Override Styles */ | ||
.tocify .tocify-item a, .tocify .list-group-item { | ||
padding: 5px; | ||
} | ||
|
||
.tocify .nav-pills > li { | ||
float: none; | ||
} | ||
|
||
/* We don't override the bootstrap colors because this gives us the | ||
wrong selection colors when using bootstrap themes | ||
.tocify .list-group-item:hover, .tocify .list-group-item:focus { | ||
background-color: #f5f5f5; | ||
} | ||
.tocify .list-group-item.active:hover, .tocify .list-group-item.active:focus { | ||
background-color: #428bca; | ||
} | ||
*/ | ||
|
||
/* End Twitter Bootstrap Override Styles */ |
Oops, something went wrong.