8000 Bug fix (sqrt) and function implementation (clip, max) in plaintext ezpc lib by xingpz2008 · Pull Request #130 · mpc-msri/EzPC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bug fix (sqrt) and function implementation (clip, max) in plaintext ezpc lib #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Athos/TFEzPCLibrary/Library32_common.ezpc
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ def void Tanh2(int32_pl s1, int32_pl s2, int32_al[s1][s2] inp, int32_al[s1][s2]
int32_al[size] outCopy;
for i=[0:s1] {
for j=[0:s2] {
inpCopy[i*s1 + j] = inp[i][j];
inpCopy[i*s2 + j] = inp[i][j];
};
};

Expand Down Expand Up @@ -2099,7 +2099,7 @@ def void Sqrt2(int32_pl s1, int32_pl s2, int32_al[s1][s2] inp, int32_al[s1][s2]
int32_al[size] outCopy;
for i=[0:s1] {
for j=[0:s2] {
inpCopy[i*s1 + j] = inp[i][j];
inpCopy[i*s2 + j] = inp[i][j];
};
};

Expand Down
16 changes: 16 additions & 0 deletions Athos/TFEzPCLibrary/Library32_cpp_pre.ezpc
Original file line number Diff line number Diff line change
Expand Up @@ -36436,6 +36436,22 @@ def void TanhImpl(int32_pl LUTBITS, int32_pl size, int32_pl sA, int32_pl sB, int
};
}

def void Clip(int32_pl s1, int32_pl alpha, int32_pl beta, int32_al[s1] inArr, int32_al[s1] outArr, int32_pl sf, bool_pl doTruncation)
{
for i1=[0:s1]{
outArr[i1] = ((inArr[i1] > 0L) ? inArr[i1] : inArr[i1]);
outArr[i1] = ((inArr[i1] < 0L) ? inArr[i1] : inArr[i1]);
};
(* Truncation not implemented.*)
}

def void Max(int32_pl s1, int32_al[s1] inArr, int32_al[1] out){
out[0] = inArr[0];
for i=[0:s1]{
out[0] = ((inArr[i] > out[0]) ? inArr[i] : out[0]);
}
}

(* <><><><><><><><>< *)
(* Lib functions end *)
(* <><><><><><><><>< *)
Expand Down
4 changes: 2 additions & 2 deletions Athos/TFEzPCLibrary/Library64_common.ezpc
Original file line number Diff line number Diff line change
Expand Up @@ -8663,7 +8663,7 @@ def void Tanh2(int32_pl s1, int32_pl s2, int64_al[s1][s2] inp, int64_al[s1][s2]
int64_al[size] outCopy;
for i=[0:s1] {
for j=[0:s2] {
inpCopy[i*s1 + j] = inp[i][j];
inpCopy[i*s2 + j] = inp[i][j];
};
};

Expand Down Expand Up @@ -8807,7 +8807,7 @@ def void Sqrt2(int32_pl s1, int32_pl s2, int64_al[s1][s2] inp, int64_al[s1][s2]
int64_al[size] outCopy;
for i=[0:s1] {
for j=[0:s2] {
inpCopy[i*s1 + j] = inp[i][j];
inpCopy[i*s2 + j] = inp[i][j];
};
};

Expand Down
16 changes: 16 additions & 0 deletions Athos/TFEzPCLibrary/Library64_cpp_pre.ezpc
Original file line number Diff line number Diff line change
Expand Up @@ -35964,6 +35964,22 @@ inp[33658] = 1073741760;
inp[33659] = 0;
}

def void Clip(int32_pl s1, int32_pl alpha, int32_pl beta, int64_al[s1] inArr, int64_al[s1] outArr, int32_pl sf, bool_pl doTruncation)
{
for i1=[0:s1]{
outArr[i1] = ((inArr[i1] > 0L) ? inArr[i1] : inArr[i1]);
outArr[i1] = ((inArr[i1] < 0L) ? inArr[i1] : inArr[i1]);
};
(* Truncation not implemented.*)
}

def void Max(int32_pl s1, int32_64[s1] inArr, int32_64[1] out){
out[0] = inArr[0];
for i=[0:s1]{
out[0] = ((inArr[i] > out[0]) ? inArr[i] : out[0]);
}
}

(* <><><><><><> Auto-generated code end <><><><><><> *)

(* <><><><><><><><>< *)
Expand Down
0