Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NiuTrans.Tensor
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
8
Issues
8
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
NiuTrans
NiuTrans.Tensor
Commits
4faf81de
Commit
4faf81de
authored
Jul 23, 2019
by
liyinqiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixed
1. Enable the isGradEfficient; 2. Adjust global memory size.
parent
d969fe7b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
source/network/XNet.cpp
+1
-1
source/tensor/XMem.cpp
+4
-4
source/tensor/XMem.h
+5
-5
没有找到文件。
source/network/XNet.cpp
查看文件 @
4faf81de
...
@@ -55,7 +55,7 @@ void XNetClearAll()
...
@@ -55,7 +55,7 @@ void XNetClearAll()
XNet
::
XNet
()
XNet
::
XNet
()
{
{
nodes
.
Clear
();
nodes
.
Clear
();
isGradEfficient
=
fals
e
;
isGradEfficient
=
tru
e
;
}
}
/* de-constructor */
/* de-constructor */
...
...
source/tensor/XMem.cpp
查看文件 @
4faf81de
...
@@ -1562,9 +1562,9 @@ void XMemManager::GetBufferSize(MTYPE freeMem, MTYPE * myBufSize)
...
@@ -1562,9 +1562,9 @@ void XMemManager::GetBufferSize(MTYPE freeMem, MTYPE * myBufSize)
if
(
freeMem
>=
MILLION
*
512
){
if
(
freeMem
>=
MILLION
*
512
){
*
myBufSize
=
MILLION
*
128
;
*
myBufSize
=
MILLION
*
128
;
if
(
freeMem
>=
MILLION
*
1024
)
{
if
(
freeMem
>=
MILLION
*
1024
)
{
*
myBufSize
=
MILLION
*
256
;
*
myBufSize
=
MILLION
*
128
;
if
(
freeMem
>=
MILLION
*
2048
)
if
(
freeMem
>=
MILLION
*
2048
)
*
myBufSize
=
MILLION
*
512
;
*
myBufSize
=
MILLION
*
128
;
}
}
}
}
}
}
...
@@ -1596,9 +1596,9 @@ void XMemManager::Initialize()
...
@@ -1596,9 +1596,9 @@ void XMemManager::Initialize()
/* free it */
/* free it */
void
XMemManager
::
Free
()
void
XMemManager
::
Free
()
{
{
for
(
int
i
=
0
;
i
<
MAX_CPU_NUM
;
i
++
)
for
(
int
i
=
0
;
i
<
MAX_CPU_
MEM_
NUM
;
i
++
)
CPUMems
[
i
].
Free
();
CPUMems
[
i
].
Free
();
for
(
int
i
=
0
;
i
<
MAX_GPU_NUM
;
i
++
)
for
(
int
i
=
0
;
i
<
MAX_GPU_
MEM_
NUM
;
i
++
)
GPUMems
[
i
].
Free
();
GPUMems
[
i
].
Free
();
}
}
...
...
source/tensor/XMem.h
查看文件 @
4faf81de
...
@@ -60,10 +60,10 @@ typedef long long INT_64;
...
@@ -60,10 +60,10 @@ typedef long long INT_64;
#define CUDA_HOST_MALLOC 1
#define CUDA_HOST_MALLOC 1
#define MY_PITCH CUDA_PITCH
#define MY_PITCH CUDA_PITCH
#define BUF_PITCH 256
#define BUF_PITCH 256
#define MIN_BLOCK_SIZE_FOR_MEMPOOL
128
* 1024 * 1024
#define MIN_BLOCK_SIZE_FOR_MEMPOOL
256
* 1024 * 1024
#define MIN_BLOCK_NUM_FOR_MEMPOOL 1024
#define MIN_BLOCK_NUM_FOR_MEMPOOL 1024
#define MAX_CPU_
NUM 1
#define MAX_CPU_
MEM_NUM 16
#define MAX_GPU_
NUM 1
#define MAX_GPU_
MEM_NUM 16
/*
/*
mode of runnig a memory pool
mode of runnig a memory pool
...
@@ -434,13 +434,13 @@ class XMemManager
...
@@ -434,13 +434,13 @@ class XMemManager
{
{
private
:
private
:
/* cpu memory pool information */
/* cpu memory pool information */
XMem
CPUMems
[
MAX_CPU_NUM
];
XMem
CPUMems
[
MAX_CPU_
MEM_
NUM
];
/* number of cpu memory pools */
/* number of cpu memory pools */
int
nCPUMem
;
int
nCPUMem
;
/* gpu memory pool information */
/* gpu memory pool information */
XMem
GPUMems
[
MAX_GPU_NUM
];
XMem
GPUMems
[
MAX_GPU_
MEM_
NUM
];
/* number of gpu memory pools */
/* number of gpu memory pools */
int
nGPUMem
;
int
nGPUMem
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论