Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9896ac1e
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9896ac1e
编写于
11月 29, 2022
作者:
A
Asthestarsfalll
提交者:
GitHub
11月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PHI decoupling]migrate enforce_custom.h from fluid to phi (#48422)
* migrate enforce_custom.h from fluid to phi * move to backends/custom/
上级
fa10524d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
22 deletion
+17
-22
paddle/fluid/platform/device/device_wrapper.h
paddle/fluid/platform/device/device_wrapper.h
+1
-1
paddle/phi/backends/custom/custom_device.cc
paddle/phi/backends/custom/custom_device.cc
+2
-2
paddle/phi/backends/custom/enforce_custom.h
paddle/phi/backends/custom/enforce_custom.h
+14
-19
未找到文件。
paddle/fluid/platform/device/device_wrapper.h
浏览文件 @
9896ac1e
...
...
@@ -40,8 +40,8 @@ limitations under the License. */
#endif
#ifdef PADDLE_WITH_CUSTOM_DEVICE
#include "paddle/fluid/platform/device/custom/enforce_custom.h"
#include "paddle/phi/backends/callback_manager.h"
#include "paddle/phi/backends/custom/enforce_custom.h"
#include "paddle/phi/backends/device_guard.h"
#include "paddle/phi/backends/device_manager.h"
#include "paddle/phi/backends/event.h"
...
...
paddle/phi/backends/custom/custom_device.cc
浏览文件 @
9896ac1e
...
...
@@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/fluid/platform/device/custom/enforce_custom.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/phi/common/data_type.h"
#include "paddle/phi/backends/callback_manager.h"
#include "paddle/phi/backends/custom/enforce_custom.h"
#include "paddle/phi/backends/device_base.h"
#include "paddle/phi/backends/device_guard.h"
#include "paddle/phi/backends/device_manager.h"
#include "paddle/phi/backends/event.h"
#include "paddle/phi/backends/stream.h"
#include "paddle/phi/common/data_type.h"
static
bool
operator
==
(
const
C_Device_st
&
d1
,
const
C_Device_st
&
d2
)
{
return
d1
.
id
==
d2
.
id
;
...
...
paddle/
fluid/platform/device
/custom/enforce_custom.h
→
paddle/
phi/backends
/custom/enforce_custom.h
浏览文件 @
9896ac1e
...
...
@@ -16,12 +16,10 @@ limitations under the License. */
#ifdef PADDLE_WITH_CUSTOM_DEVICE
#include <string>
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/device_ext.h"
#include "paddle/phi/core/enforce.h"
namespace
paddle
{
namespace
platform
{
namespace
details
{
namespace
phi
{
template
<
typename
T
>
struct
CustomDeviceStatusType
{};
...
...
@@ -33,7 +31,6 @@ struct CustomDeviceStatusType {};
}
DEFINE_CUSTOM_DEVICE_STATUS_TYPE
(
C_Status
,
C_SUCCESS
);
}
// namespace details
inline
std
::
string
build_custom_device_error_msg
(
C_Status
stat
)
{
std
::
ostringstream
sout
;
...
...
@@ -45,15 +42,13 @@ inline std::string build_custom_device_error_msg(C_Status stat) {
do { \
auto __cond__ = (COND); \
using __CUSTOM_DEVICE_STATUS_TYPE__ = decltype(__cond__); \
constexpr auto __success_type__ = \
::paddle::platform::details::CustomDeviceStatusType< \
constexpr auto __success_type__ = ::phi::CustomDeviceStatusType< \
__CUSTOM_DEVICE_STATUS_TYPE__>::kSuccess; \
if (UNLIKELY(__cond__ != __success_type__)) { \
auto __summary__ = ::p
addle::platform::errors::External(
\
::p
addle::platform::build_custom_device_error_msg(__cond__));
\
auto __summary__ = ::p
hi::errors::External(
\
::p
hi::build_custom_device_error_msg(__cond__));
\
__THROW_ERROR_INTERNAL__(__summary__); \
} \
} while (0)
}
// namespace platform
}
// namespace paddle
}
// namespace phi
#endif // PADDLE_WITH_CUSTOM_DEVICE
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录