Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
383b96f3
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
383b96f3
编写于
7月 11, 2017
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FIX: merge conflicts
上级
f404282d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
8 addition
and
7 deletion
+8
-7
paddle/memory/detail/meta_cache.cc
paddle/memory/detail/meta_cache.cc
+1
-1
paddle/memory/memory.cc
paddle/memory/memory.cc
+1
-1
paddle/platform/CMakeLists.txt
paddle/platform/CMakeLists.txt
+1
-1
paddle/platform/device_context.h
paddle/platform/device_context.h
+2
-1
paddle/platform/gpu_info.cc
paddle/platform/gpu_info.cc
+2
-2
paddle/platform/gpu_info.h
paddle/platform/gpu_info.h
+1
-1
未找到文件。
paddle/memory/detail/meta_cache.cc
浏览文件 @
383b96f3
...
...
@@ -25,7 +25,7 @@ MetadataCache::MetadataCache(bool uses_gpu) : uses_gpu_(uses_gpu) {}
Metadata
MetadataCache
::
load
(
const
MemoryBlock
*
block
)
{
if
(
uses_gpu_
)
{
auto
existing_metadata
=
cache_
.
find
(
block
);
assert
(
existing_metadata
->
second
.
check_guards
());
PADDLE_ASSERT
(
existing_metadata
->
second
.
check_guards
());
return
existing_metadata
->
second
;
}
else
{
PADDLE_ASSERT
(
reinterpret_cast
<
const
Metadata
*>
(
block
)
->
check_guards
());
...
...
paddle/memory/memory.cc
浏览文件 @
383b96f3
...
...
@@ -52,7 +52,7 @@ size_t Used<platform::CPUPlace>(platform::CPUPlace place) {
detail
::
BuddyAllocator
*
GetGPUBuddyAllocator
(
int
gpu_id
)
{
static
detail
::
BuddyAllocator
**
as
=
NULL
;
if
(
as
==
NULL
)
{
int
gpu_num
=
platform
::
G
pu
DeviceCount
();
int
gpu_num
=
platform
::
G
et
DeviceCount
();
as
=
new
detail
::
BuddyAllocator
*
[
gpu_num
];
for
(
int
gpu
=
0
;
gpu
<
gpu_num
;
gpu
++
)
{
platform
::
SetDeviceId
(
gpu
);
...
...
paddle/platform/CMakeLists.txt
浏览文件 @
383b96f3
...
...
@@ -8,4 +8,4 @@ cc_test(place_test SRCS place_test.cc DEPS place glog gflags)
cc_library
(
dynamic_loader SRCS dynload/dynamic_loader.cc DEPS gflags glog
)
nv_test
(
device_context_test SRCS device_context_test.cc DEPS dynamic_loader place eigen3
)
nv_test
(
device_context_test SRCS device_context_test.cc DEPS dynamic_loader place eigen3
gpu_info
)
paddle/platform/device_context.h
浏览文件 @
383b96f3
...
...
@@ -16,10 +16,11 @@ limitations under the License. */
#include "paddle/framework/enforce.h"
#ifndef PADDLE_ONLY_CPU
#include "paddle/platform/cuda.h"
#include "paddle/platform/dynload/cublas.h"
#include "paddle/platform/dynload/cudnn.h"
#include "paddle/platform/dynload/curand.h"
#include "paddle/platform/error.h"
#include "paddle/platform/gpu_info.h"
#define EIGEN_USE_GPU
#endif
#include "paddle/platform/place.h"
...
...
paddle/platform/gpu_info.cc
浏览文件 @
383b96f3
...
...
@@ -23,11 +23,11 @@ DEFINE_double(fraction_of_gpu_memory_to_use, 0.95,
namespace
paddle
{
namespace
platform
{
int
G
pu
DeviceCount
()
{
int
G
et
DeviceCount
()
{
int
count
;
throw_on_error
(
cudaGetDeviceCount
(
&
count
),
"cudaGetDeviceCount failed in paddle::platform::G
pu
DeviceCount"
);
"cudaGetDeviceCount failed in paddle::platform::G
et
DeviceCount"
);
return
count
;
}
...
...
paddle/platform/gpu_info.h
浏览文件 @
383b96f3
...
...
@@ -22,7 +22,7 @@ namespace paddle {
namespace
platform
{
//! Get the total number of GPU devices in system.
int
G
pu
DeviceCount
();
int
G
et
DeviceCount
();
//! Get the current GPU device id in system.
int
GetCurrentDeviceId
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录