-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 parent
c8d7b78
commit 6631f06
Showing
7 changed files
with
108 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.sh |
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,13 @@ | ||
FROM marblehe/base_cingulata | ||
|
||
# copy eval program into container | ||
COPY source /root/eval | ||
|
||
# build the benchmark | ||
WORKDIR /root/eval | ||
RUN mkdir build | ||
WORKDIR /root/eval/build | ||
RUN cmake ..; make | ||
|
||
# execute the benchmark and upload benchmark results to S3 | ||
CMD ["sh", "-c", "./benchmark > result_benchmark_cingulata.csv; aws s3 cp result_benchmark_cingulata.csv s3://sok-repository-cingulata-benchmarks"] |
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 @@ | ||
# Cingulata |
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,15 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") | ||
|
||
project(eval_benchmark) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
find_package(Cingulata REQUIRED) | ||
find_package(Threads REQUIRED) | ||
|
||
add_executable(benchmark main.cpp) | ||
|
||
target_include_directories(benchmark PRIVATE ${Cingulata_INCLUDE_DIR}) | ||
target_link_libraries(benchmark PRIVATE ${Cingulata_LIBRARY}) | ||
target_link_libraries(benchmark PRIVATE Threads::Threads) |
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,12 @@ | ||
find_path(Cingulata_INCLUDE_DIR NAMES ci_int.hxx PATHS /cingu/common/include) | ||
find_library(Cingulata_LIBRARY NAMES common PATHS /cingu/build_bfv/common/src) | ||
|
||
|
||
set(Cingulata_INCLUDE_DIRS ${Cingulata_INCLUDE_DIR}) | ||
set(Cingulata_LIBRARIES ${Cingulata_LIBRARY}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Cingulata DEFAULT_MSG | ||
Cingulata_LIBRARIES Cingulata_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(Cingulata_LIBRARY Cingulata_INCLUDE_DIR) |
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,65 @@ | ||
/* | ||
(C) Copyright 2019 CEA LIST. All Rights Reserved. | ||
Contributor(s): Cingulata team (formerly Armadillo team) | ||
This software is governed by the CeCILL-C license under French law and | ||
abiding by the rules of distribution of free software. You can use, | ||
modify and/ or redistribute the software under the terms of the CeCILL-C | ||
license as circulated by CEA, CNRS and INRIA at the following URL | ||
"http://www.cecill.info". | ||
As a counterpart to the access to the source code and rights to copy, | ||
modify and redistribute granted by the license, users are provided only | ||
with a limited warranty and the software's author, the holder of the | ||
economic rights, and the successive licensors have only limited | ||
liability. | ||
The fact that you are presently reading this means that you have had | ||
knowledge of the CeCILL-C license and that you accept its terms. | ||
*/ | ||
|
||
#define blif_name "bfv-hello.blif" | ||
|
||
#include <cstdint> | ||
|
||
/* local includes */ | ||
#include <bit_exec/decorator/attach.hxx> | ||
#include <bit_exec/decorator/depth.hxx> | ||
#include <bit_exec/decorator/stat.hxx> | ||
#include <bit_exec/tracker.hxx> | ||
#include <ci_context.hxx> | ||
#include <ci_int.hxx> | ||
#include <int_op_gen/mult_depth.hxx> | ||
|
||
/* namespaces */ | ||
using namespace std; | ||
using namespace cingulata; | ||
|
||
int main() { | ||
/* Set context to bit tracker and multiplicative depth minimized integer | ||
* operations */ | ||
CiContext::set_config( | ||
make_shared<decorator::Attach<BitTracker, decorator::Depth<IBitExecSHE>, | ||
decorator::Stat<IBitExecSHE>>>(), | ||
make_shared<IntOpGenDepth>()); | ||
|
||
CiInt a{CiInt::u8}; // create from unsigned 8-bit template | ||
CiInt b{CiInt::u8v(42)}; // use helper function to create an unsigned 8-bit | ||
CiInt c{-1, 16, false}; // or manually specify value, size and signedness | ||
|
||
a.read("a"); // read variable a and set name | ||
|
||
b.set_name("b"); // set name and ... | ||
cin >> b; // read variable b | ||
|
||
c = a + b; | ||
|
||
cout << c.set_name("c"); // set name and write variable | ||
// c.write("c"); // or do it at once | ||
|
||
/* Export to file the "tracked" circuit */ | ||
CiContext::get_bit_exec_t<BitTracker>()->export_blif(blif_name, "hello"); | ||
|
||
CiContext::get_bit_exec_t<decorator::Depth<IBitExecSHE>>()->print(); | ||
CiContext::get_bit_exec_t<decorator::Stat<IBitExecSHE>>()->print(); | ||
} |