Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5ec9a5ce
提交
5ec9a5ce
authored
4月 23, 2014
作者:
f0k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed gpu.release_gil config flag again, releasing GIL by default now
上级
45f4b7a9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
16 行删除
+15
-16
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+15
-0
cuda_ndarray.cuh
theano/sandbox/cuda/cuda_ndarray.cuh
+0
-8
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+0
-8
没有找到文件。
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
5ec9a5ce
...
...
@@ -26,6 +26,21 @@
//if you want this to work.
#define PRECHECK_ERROR 0
//If true, we release the GIL around blocking GPU calls, to allow other Python
//threads to run in the meantime. For a single-threaded program, the overhead
//is neglectible (about 20ms for 1 million GIL release/reclaim cycles). Can
//still be overridden on compilation with -DRELEASE_GIL=0 in nvcc.flags.
#ifndef RELEASE_GIL
#define RELEASE_GIL 1
#endif
#if RELEASE_GIL
#define CNDA_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
#define CNDA_END_ALLOW_THREADS Py_END_ALLOW_THREADS
#else
#define CNDA_BEGIN_ALLOW_THREADS
#define CNDA_END_ALLOW_THREADS
#endif
/////////////////////////
// Alloc and Free
/////////////////////////
...
...
theano/sandbox/cuda/cuda_ndarray.cuh
浏览文件 @
5ec9a5ce
...
...
@@ -68,14 +68,6 @@ typedef float real;
#define CNDA_THREAD_SYNC cudaThreadSynchronize();
#endif
// Define shortcuts to implement the config.gpu.release_gil flag
#ifdef RELEASE_GIL
#define CNDA_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
#define CNDA_END_ALLOW_THREADS Py_END_ALLOW_THREADS
#else
#define CNDA_BEGIN_ALLOW_THREADS
#define CNDA_END_ALLOW_THREADS
#endif
#ifndef SHARED_SIZE
#define SHARED_SIZE (16*1024)
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
5ec9a5ce
...
...
@@ -30,12 +30,6 @@ AddConfigVar('nvcc.compiler_bindir',
StrParam
(
""
),
in_c_key
=
False
)
AddConfigVar
(
'gpu.release_gil'
,
"If True, theano will release the GIL when waiting for "
"GPU operations, allowing other Python threads to run"
,
BoolParam
(
False
),
in_c_key
=
True
)
user_provided_cuda_root
=
True
...
...
@@ -159,8 +153,6 @@ class NVCC_compiler(object):
flags
=
[
flag
for
flag
in
config
.
nvcc
.
flags
.
split
(
' '
)
if
flag
]
if
config
.
nvcc
.
fastmath
:
flags
.
append
(
'-use_fast_math'
)
if
config
.
gpu
.
release_gil
:
flags
.
append
(
'-DRELEASE_GIL'
)
cuda_ndarray_cuh_hash
=
hash_from_file
(
os
.
path
.
join
(
os
.
path
.
split
(
__file__
)[
0
],
'cuda_ndarray.cuh'
))
flags
.
append
(
'-DCUDA_NDARRAY_CUH='
+
cuda_ndarray_cuh_hash
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论