1 Star 0 Fork 40

yoo/pytorch

forked from src-openEuler/pytorch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-Update-gloo-for-gcc11-compile.patch 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
diff -Naur a/third_party/gloo/gloo/common/linux.cc b/third_party/gloo/gloo/common/linux.cc
--- a/third_party/gloo/gloo/common/linux.cc 2022-03-11 01:01:52.000000000 +0800
+++ b/third_party/gloo/gloo/common/linux.cc 2023-02-16 11:09:11.493631531 +0800
@@ -187,29 +187,28 @@
static int getInterfaceSpeedGLinkSettings(int sock, struct ifreq* ifr) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
constexpr auto link_mode_data_nwords = 3 * 127;
- struct {
- struct ethtool_link_settings req;
- __u32 link_mode_data[link_mode_data_nwords];
- } ecmd;
+ constexpr auto bufsize = sizeof(struct ethtool_link_settings) + sizeof(__u32)*link_mode_data_nwords;
+ char buf[bufsize];
+ struct ethtool_link_settings* ecmd = (struct ethtool_link_settings*)buf;
int rv;
- ifr->ifr_data = (__caddr_t)&ecmd;
- memset(&ecmd, 0, sizeof(ecmd));
- ecmd.req.cmd = ETHTOOL_GLINKSETTINGS;
+ ifr->ifr_data = (__caddr_t)buf;
+ memset(buf, 0, bufsize);
+ ecmd->cmd = ETHTOOL_GLINKSETTINGS;
rv = ioctl(sock, SIOCETHTOOL, ifr);
- if (rv < 0 || ecmd.req.link_mode_masks_nwords >= 0) {
+ if (rv < 0 || ecmd->link_mode_masks_nwords >= 0) {
return SPEED_UNKNOWN;
}
- ecmd.req.cmd = ETHTOOL_GLINKSETTINGS;
- ecmd.req.link_mode_masks_nwords = -ecmd.req.link_mode_masks_nwords;
+ ecmd->cmd = ETHTOOL_GLINKSETTINGS;
+ ecmd->link_mode_masks_nwords = - (ecmd->link_mode_masks_nwords);
rv = ioctl(sock, SIOCETHTOOL, ifr);
if (rv < 0) {
return SPEED_UNKNOWN;
}
- return ecmd.req.speed;
+ return ecmd->speed;
#else
(void)sock;
(void)ifr;
diff -Naur a/third_party/gloo/gloo/test/tls_tcp_test.cc b/third_party/gloo/gloo/test/tls_tcp_test.cc
--- a/third_party/gloo/gloo/test/tls_tcp_test.cc 2022-03-11 01:01:52.000000000 +0800
+++ b/third_party/gloo/gloo/test/tls_tcp_test.cc 2023-02-16 11:12:33.779302224 +0800
@@ -72,7 +72,7 @@
}
} catch (::gloo::IoException e) {
exception_thrown = true;
- ASSERT_THAT(e.what(), ::testing::ContainsRegex("unknown ca"));
+ ASSERT_THAT(e.what(), ::testing::ContainsRegex("[unknown ca|Connect timeout|Connection refused]"));
} catch (::gloo::EnforceNotMet e) {
exception_thrown = true;
ASSERT_THAT(e.what(),
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdLUbG/pytorch.git
git@gitee.com:mdLUbG/pytorch.git
mdLUbG
pytorch
pytorch
master

搜索帮助