-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added tuning and graphics to cmake
- replaced RTDSC timers with a more standard one - made gnuplot generated plots available via tune_it.sh - moved timing points in tune.c to avoid elimination by optimization
- Loading branch information
1 parent
5809141
commit 6fa425e
Showing
19 changed files
with
385 additions
and
129 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
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
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
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
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,51 @@ | ||
# SPDX-License-Identifier: Unlicense | ||
# | ||
# LibTomMath, a free open source portable number theoretic multiple-precision | ||
# integer (MPI) library written entirely in C. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.10) | ||
|
||
set(LTM_TUNE tune-ltm) | ||
|
||
# This file can be included from the top level or used stand-alone | ||
if(PROJECT_NAME) | ||
set(LIBRARY_NAME ${PROJECT_NAME}) | ||
else() | ||
# Define an independent project and all the necessary stuff around | ||
project(${LTM_TUNE} | ||
LANGUAGES C) | ||
set(LIBRARY_NAME libtommath) | ||
find_package(${LIBRARY_NAME}) | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
endif() | ||
endif() | ||
|
||
add_executable(tune | ||
${CMAKE_CURRENT_SOURCE_DIR}/tune.c | ||
) | ||
|
||
target_include_directories(tune PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/.. | ||
) | ||
|
||
target_link_libraries(tune PRIVATE | ||
${LIBRARY_NAME} | ||
) | ||
|
||
target_compile_options(tune PRIVATE | ||
${LTM_C_FLAGS} | ||
) | ||
target_link_options(tune BEFORE PUBLIC | ||
${LTM_LD_FLAGS} | ||
) | ||
|
||
if(BUILD_GRAPHS) | ||
# used in tune_it.sh | ||
find_program(GNUPLOT gnuplot) | ||
add_custom_command(TARGET tune POST_BUILD COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tune_it.sh 1000 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM) | ||
else() | ||
add_custom_command(TARGET tune POST_BUILD COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tune_it.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM) | ||
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
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
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,19 @@ | ||
set term pngcairo size 720,540 | ||
# Good for most colorblinds | ||
set colorsequence podo | ||
|
||
set key top left; | ||
|
||
set ylabel "Time" | ||
set xlabel "Operand size (limbs)" | ||
|
||
set output "multiplying".ARG1.".png"; | ||
set title "Comparing fast and slow multiplying [".ARG1." bits limbsize]"; | ||
plot "multiplying".ARG1."" using 1:2 w lines t "slow", "multiplying".ARG1."" using 1:3 w lines t "fast" | ||
|
||
set output "squaring".ARG1.".png"; | ||
set title "Comparing fast and slow squaring [".ARG1." bits limbsize]"; | ||
plot "squaring".ARG1."" using 1:2 w lines t "slow", "squaring".ARG1."" using 1:3 w lines t "fast" | ||
|
||
|
||
|
Oops, something went wrong.