Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
PALISADE
PALISADE Development
Commits
c285f5bf
Commit
c285f5bf
authored
Jan 22, 2018
by
Gerard Ryan
Browse files
all poly benchmarks run
parent
838ad10e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
44 deletions
+21
-44
benchmark/src/Lattice.cpp
benchmark/src/Lattice.cpp
+21
-44
No files found.
benchmark/src/Lattice.cpp
View file @
c285f5bf
...
...
@@ -231,29 +231,6 @@ static shared_ptr<ILDCRTParams<I>> generate_DCRT_parms(int s) {
return
shared_ptr
<
ILDCRTParams
<
I
>>
(
new
ILDCRTParams
<
I
>
(
Scenarios
[
s
].
m
,
moduli
,
rootsOfUnity
)
);
}
// statically construct 'em
//vector<shared_ptr<ILParams>> vparms = { generate_IL_parms<ILParams,BigInteger>(0), generate_IL_parms<ILParams,BigInteger>(1) };
//vector<shared_ptr<ILDCRTParams<BigInteger>>> vaparms = { generate_DCRT_parms<BigInteger>(0), generate_DCRT_parms<BigInteger>(1) };
//vector<shared_ptr<BE2ILParams>> BE2vparms = { generate_IL_parms<BE2ILParams,BE2Integer>(0), generate_IL_parms<BE2ILParams,BE2Integer>(1) };
//vector<shared_ptr<ILDCRTParams<BE2Integer>>> BE2vaparms = { generate_DCRT_parms<BigInteger>(0), generate_DCRT_parms<BigInteger>(1) };
//vector<shared_ptr<BE4ILParams>> BE4vparms = { generate_IL_parms<BE4ILParams,BE4Integer>(0), generate_IL_parms<BE4ILParams,BE4Integer>(1) };
//vector<shared_ptr<ILDCRTParams<BigInteger>>> BE4vaparms = { generate_DCRT_parms<BigInteger>(0), generate_DCRT_parms<BigInteger>(1) };
//vector<shared_ptr<BE6ILParams>> BE6vparms = { generate_IL_parms<BE6ILParams,BE6Integer>(0), generate_IL_parms<BE6ILParams,BE6Integer>(1) };
//vector<shared_ptr<ILDCRTParams<BigInteger>>> BE6vaparms = { generate_DCRT_parms<BigInteger>(0), generate_DCRT_parms<BigInteger>(1) };
//template <typename P>
//shared_ptr<P> GetTestParms(int i);
//
//template<>
//shared_ptr<BE2ILParams> GetTestParms(int i) { return BE2vparms[i]; }
//
//template<>
//shared_ptr<BE4ILParams> GetTestParms(int i) { return BE4vparms[i]; }
//
//template<>
//shared_ptr<BE6ILParams> GetTestParms(int i) { return BE6vparms[i]; }
template
<
typename
E
>
static
void
make_LATTICE_empty
(
shared_ptr
<
typename
E
::
Params
>
params
)
{
E
v1
(
params
);
...
...
@@ -298,7 +275,7 @@ static E makeElement(shared_ptr<lbcrypto::ILParamsImpl<typename E::Integer>> par
template
<
typename
E
>
static
E
makeElement
(
shared_ptr
<
lbcrypto
::
ILDCRTParams
<
typename
E
::
Integer
>>
p
)
{
shared_ptr
<
ILParamsImpl
<
typename
E
::
Integer
>>
params
(
new
ILParamsImpl
<
typename
E
::
Integer
>
(
p
->
GetCyclotomicOrder
(),
p
->
GetModulus
(),
1
)
);
typename
E
::
Vector
vec
=
makeVector
<
E
>
(
params
);
typename
E
::
Vector
vec
=
makeVector
<
typename
E
::
PolyLargeType
>
(
params
);
typename
E
::
PolyLargeType
bigE
(
params
);
bigE
.
SetValues
(
vec
,
bigE
.
GetFormat
());
...
...
@@ -327,8 +304,8 @@ DO_POLY_BENCHMARK_TEMPLATE(BM_LATTICE_vector,BE2Poly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_LATTICE_vector
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_LATTICE_vector
,
BE6Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_LATTICE_vector
,
BE2DCRTPoly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_LATTICE_vector,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_LATTICE_vector,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_LATTICE_vector
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_LATTICE_vector
,
BE6DCRTPoly
)
// plus
template
<
typename
E
>
...
...
@@ -355,9 +332,9 @@ static void BM_add_LATTICE(benchmark::State& state) { // benchmark
DO_POLY_BENCHMARK_TEMPLATE
(
BM_add_LATTICE
,
BE2Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_add_LATTICE
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_add_LATTICE
,
BE6Poly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_add_LATTICE,BE2DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_add_LATTICE,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_add_LATTICE,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_add_LATTICE
,
BE2DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_add_LATTICE
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_add_LATTICE
,
BE6DCRTPoly
)
// plus=
template
<
typename
E
>
...
...
@@ -384,9 +361,9 @@ static void BM_addeq_LATTICE(benchmark::State& state) { // benchmark
DO_POLY_BENCHMARK_TEMPLATE
(
BM_addeq_LATTICE
,
BE2Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_addeq_LATTICE
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_addeq_LATTICE
,
BE6Poly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_addeq_LATTICE,BE2DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_addeq_LATTICE,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_addeq_LATTICE,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_addeq_LATTICE
,
BE2DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_addeq_LATTICE
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_addeq_LATTICE
,
BE6DCRTPoly
)
template
<
class
E
>
static
void
mult_LATTICE
(
benchmark
::
State
&
state
,
shared_ptr
<
typename
E
::
Params
>
params
)
{
// function
...
...
@@ -412,9 +389,9 @@ static void BM_mult_LATTICE(benchmark::State& state) { // benchmark
DO_POLY_BENCHMARK_TEMPLATE
(
BM_mult_LATTICE
,
BE2Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_mult_LATTICE
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_mult_LATTICE
,
BE6Poly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_mult_LATTICE,BE2DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_mult_LATTICE,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_mult_LATTICE,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_mult_LATTICE
,
BE2DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_mult_LATTICE
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_mult_LATTICE
,
BE6DCRTPoly
)
template
<
class
E
>
static
void
multeq_LATTICE
(
benchmark
::
State
&
state
,
shared_ptr
<
typename
E
::
Params
>
params
)
{
// function
...
...
@@ -440,9 +417,9 @@ static void BM_multeq_LATTICE(benchmark::State& state) { // benchmark
DO_POLY_BENCHMARK_TEMPLATE
(
BM_multeq_LATTICE
,
BE2Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_multeq_LATTICE
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_multeq_LATTICE
,
BE6Poly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_multeq_LATTICE,BE2DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_multeq_LATTICE,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_multeq_LATTICE,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_multeq_LATTICE
,
BE2DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_multeq_LATTICE
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_multeq_LATTICE
,
BE6DCRTPoly
)
template
<
class
E
>
static
void
switchformat_LATTICE
(
benchmark
::
State
&
state
,
shared_ptr
<
typename
E
::
Params
>
params
)
{
...
...
@@ -467,9 +444,9 @@ static void BM_switchformat_LATTICE(benchmark::State& state) { // benchmark
DO_POLY_BENCHMARK_TEMPLATE
(
BM_switchformat_LATTICE
,
BE2Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_switchformat_LATTICE
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_switchformat_LATTICE
,
BE6Poly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_switchformat_LATTICE,BE2DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_switchformat_LATTICE,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_switchformat_LATTICE,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_switchformat_LATTICE
,
BE2DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_switchformat_LATTICE
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_switchformat_LATTICE
,
BE6DCRTPoly
)
template
<
class
E
>
static
void
doubleswitchformat_LATTICE
(
benchmark
::
State
&
state
,
shared_ptr
<
typename
E
::
Params
>
params
)
{
...
...
@@ -495,9 +472,9 @@ static void BM_doubleswitchformat_LATTICE(benchmark::State& state) { // benchmar
DO_POLY_BENCHMARK_TEMPLATE
(
BM_doubleswitchformat_LATTICE
,
BE2Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_doubleswitchformat_LATTICE
,
BE4Poly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_doubleswitchformat_LATTICE
,
BE6Poly
)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_doubleswitchformat_LATTICE,BE2DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_doubleswitchformat_LATTICE,BE4DCRTPoly)
//
DO_POLY_BENCHMARK_TEMPLATE(BM_doubleswitchformat_LATTICE,BE6DCRTPoly)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_doubleswitchformat_LATTICE
,
BE2DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_doubleswitchformat_LATTICE
,
BE4DCRTPoly
)
DO_POLY_BENCHMARK_TEMPLATE
(
BM_doubleswitchformat_LATTICE
,
BE6DCRTPoly
)
//execute the benchmarks
BENCHMARK_MAIN
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment