Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
3b8f0a64
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3b8f0a64
编写于
7月 02, 2020
作者:
M
MRXLT
提交者:
GitHub
7月 02, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Encryption infer (#25119)
* add encrypt api for inference lib
上级
46214e59
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
10 deletion
+26
-10
cmake/generic.cmake
cmake/generic.cmake
+2
-0
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+9
-1
paddle/fluid/framework/io/crypto/aes_cipher_test.cc
paddle/fluid/framework/io/crypto/aes_cipher_test.cc
+1
-1
paddle/fluid/framework/io/crypto/cipher.cc
paddle/fluid/framework/io/crypto/cipher.cc
+8
-1
paddle/fluid/framework/io/crypto/cipher.h
paddle/fluid/framework/io/crypto/cipher.h
+0
-1
paddle/fluid/framework/io/crypto/cipher_utils.h
paddle/fluid/framework/io/crypto/cipher_utils.h
+1
-3
paddle/fluid/inference/api/paddle_api.h
paddle/fluid/inference/api/paddle_api.h
+5
-3
未找到文件。
cmake/generic.cmake
浏览文件 @
3b8f0a64
...
...
@@ -89,6 +89,8 @@
# including binary directory for generated headers.
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
# including io directory for inference lib paddle_api.h
include_directories
(
"
${
PADDLE_SOURCE_DIR
}
/paddle/fluid/framework/io"
)
if
(
NOT APPLE
)
find_package
(
Threads REQUIRED
)
...
...
cmake/inference_lib.cmake
浏览文件 @
3b8f0a64
...
...
@@ -107,6 +107,11 @@ function(copy_part_of_thrid_party TARGET DST)
SRCS
${
GLOG_INCLUDE_DIR
}
${
GLOG_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
)
set
(
dst_dir
"
${
DST
}
/third_party/install/cryptopp"
)
copy
(
${
TARGET
}
SRCS
${
CRYPTOPP_INCLUDE_DIR
}
${
CRYPTOPP_LIBRARIES
}
DSTS
${
dst_dir
}
${
dst_dir
}
/lib
)
set
(
dst_dir
"
${
DST
}
/third_party/install/xxhash"
)
copy
(
${
TARGET
}
SRCS
${
XXHASH_INCLUDE_DIR
}
${
XXHASH_LIBRARIES
}
...
...
@@ -178,7 +183,10 @@ endif()
copy
(
inference_lib_dist
SRCS
${
CMAKE_BINARY_DIR
}
/paddle/fluid/framework/framework.pb.h
DSTS
${
FLUID_INFERENCE_INSTALL_DIR
}
/paddle/include/internal
)
copy
(
inference_lib_dist
SRCS
${
CMAKE_BINARY_DIR
}
/../paddle/fluid/framework/io/crypto/cipher.h
DSTS
${
FLUID_INFERENCE_INSTALL_DIR
}
/paddle/include/crypto/
)
include_directories
(
${
CMAKE_BINARY_DIR
}
/../paddle/fluid/framework/io
)
# CAPI inference library for only inference
set
(
FLUID_INFERENCE_C_INSTALL_DIR
"
${
CMAKE_BINARY_DIR
}
/fluid_inference_c_install_dir"
CACHE STRING
"A path setting CAPI fluid inference shared"
)
...
...
paddle/fluid/framework/io/crypto/aes_cipher_test.cc
浏览文件 @
3b8f0a64
...
...
@@ -18,9 +18,9 @@ limitations under the License. */
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <fstream>
#include <string>
#include <vector>
#include "paddle/fluid/framework/io/crypto/cipher.h"
#include "paddle/fluid/framework/io/crypto/cipher_utils.h"
...
...
paddle/fluid/framework/io/crypto/cipher.cc
浏览文件 @
3b8f0a64
...
...
@@ -16,7 +16,9 @@
#include "paddle/fluid/framework/io/crypto/aes_cipher.h"
#include "paddle/fluid/framework/io/crypto/cipher_utils.h"
#include "paddle/fluid/platform/enforce.h"
#ifdef ON_INFER
#include "paddle/fluid/inference/api/paddle_api.h"
#endif
namespace
paddle
{
namespace
framework
{
...
...
@@ -57,4 +59,9 @@ std::shared_ptr<Cipher> CipherFactory::CreateCipher(
}
}
// namespace framework
#ifdef ON_INFER
std
::
shared_ptr
<
framework
::
Cipher
>
MakeCipher
(
const
std
::
string
&
config_file
)
{
return
framework
::
CipherFactory
::
CreateCipher
(
config_file
);
}
#endif
}
// namespace paddle
paddle/fluid/framework/io/crypto/cipher.h
浏览文件 @
3b8f0a64
...
...
@@ -46,6 +46,5 @@ class CipherFactory {
CipherFactory
()
=
default
;
static
std
::
shared_ptr
<
Cipher
>
CreateCipher
(
const
std
::
string
&
config_file
);
};
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/io/crypto/cipher_utils.h
浏览文件 @
3b8f0a64
...
...
@@ -14,11 +14,9 @@
#pragma once
#include <sstream>
#include <string>
#include <unordered_map>
#include "paddle/fluid/platform/enforce.h"
namespace
paddle
{
namespace
framework
{
...
...
paddle/fluid/inference/api/paddle_api.h
浏览文件 @
3b8f0a64
...
...
@@ -27,10 +27,10 @@
#include <memory>
#include <string>
#include <vector>
#include "crypto/cipher.h"
#include "paddle_infer_declare.h" // NOLINT
/*! \namespace paddle
*/
/*! \namespace paddle
*/
namespace
paddle
{
/// \brief Paddle data type.
...
...
@@ -431,4 +431,6 @@ PD_INFER_DECL std::string get_version();
PD_INFER_DECL
std
::
string
UpdateDllFlag
(
const
char
*
name
,
const
char
*
value
);
PD_INFER_DECL
std
::
shared_ptr
<
framework
::
Cipher
>
MakeCipher
(
const
std
::
string
&
config_file
);
}
// namespace paddle
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录