未验证 提交 464f65b1 编写于 作者: R ronnywang 提交者: GitHub

add CHECK_VERSION macro (#40512)

上级 f84b54eb
......@@ -523,6 +523,15 @@ struct CustomRuntimeParams {
char reserved[32];
};
#define PADDLE_CUSTOM_RUNTIME_CHECK_VERSION(params) \
if ((params)->size != sizeof(DevicePluginParams) && \
(params)->interface->size != sizeof(C_DeviceInterface)) { \
return; \
} \
(params)->version.major = PADDLE_DEVICE_PLUGIN_MAJOR_VERSION; \
(params)->version.minor = PADDLE_DEVICE_PLUGIN_MINOR_VERSION; \
(params)->version.patch = PADDLE_DEVICE_PLUGIN_PATCH_VERSION;
// Plugin implement it and fill CustomRuntimeParams
void InitPlugin(CustomRuntimeParams*);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册