Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
502e6d5f
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
502e6d5f
编写于
9月 24, 2018
作者:
J
jmtao
提交者:
Jiangtao Hu
9月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perceotion: migrate blob/common/syncedmen
上级
cb77516e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
7 deletion
+47
-7
modules/perception/base/BUILD
modules/perception/base/BUILD
+36
-0
modules/perception/base/blob.cc
modules/perception/base/blob.cc
+0
-1
modules/perception/base/blob.h
modules/perception/base/blob.h
+0
-2
modules/perception/base/common.h
modules/perception/base/common.h
+0
-1
modules/perception/base/syncedmem.h
modules/perception/base/syncedmem.h
+11
-3
未找到文件。
modules/perception/base/BUILD
浏览文件 @
502e6d5f
...
@@ -2,6 +2,29 @@ load("//tools:cpplint.bzl", "cpplint")
...
@@ -2,6 +2,29 @@ load("//tools:cpplint.bzl", "cpplint")
package
(
default_visibility
=
[
"//visibility:public"
])
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"blob"
,
srcs
=
[
"blob.cc"
,
],
hdrs
=
[
"blob.h"
,
],
deps
=
[
":common"
,
":syncedmem"
,
],
)
cc_library
(
name
=
"common"
,
hdrs
=
[
"common.h"
,
],
deps
=
[
],
)
cc_library
(
cc_library
(
name
=
"point_cloud"
,
name
=
"point_cloud"
,
hdrs
=
[
hdrs
=
[
...
@@ -91,4 +114,17 @@ cc_test(
...
@@ -91,4 +114,17 @@ cc_test(
],
],
)
)
cc_library
(
name
=
"syncedmem"
,
srcs
=
[
"syncedmem.cc"
,
],
hdrs
=
[
"syncedmem.h"
,
],
deps
=
[
":common"
,
],
)
cpplint
()
cpplint
()
modules/perception/base/blob.cc
浏览文件 @
502e6d5f
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
#include <vector>
#include <vector>
#include "modules/perception/base/blob.h"
#include "modules/perception/base/blob.h"
#include "modules/perception/base/syncedmem.h"
namespace
apollo
{
namespace
apollo
{
namespace
perception
{
namespace
perception
{
...
...
modules/perception/base/blob.h
浏览文件 @
502e6d5f
...
@@ -16,9 +16,7 @@
...
@@ -16,9 +16,7 @@
#ifndef MODULES_PERCEPTION_BASE_BLOB_H_
#ifndef MODULES_PERCEPTION_BASE_BLOB_H_
#define MODULES_PERCEPTION_BASE_BLOB_H_
#define MODULES_PERCEPTION_BASE_BLOB_H_
#include <algorithm>
#include <memory>
#include <memory>
#include <sstream>
#include <string>
#include <string>
#include <vector>
#include <vector>
...
...
modules/perception/base/common.h
浏览文件 @
502e6d5f
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
#define MODULES_PERCEPTION_BASE_COMMON_H_
#define MODULES_PERCEPTION_BASE_COMMON_H_
#include <assert.h>
#include <assert.h>
#include "modules/perception/base/options_define.h"
#ifndef PERCEPTION_CPU_ONLY
#ifndef PERCEPTION_CPU_ONLY
...
...
modules/perception/base/syncedmem.h
浏览文件 @
502e6d5f
...
@@ -55,19 +55,26 @@ inline void PerceptionFreeHost(void* ptr, bool use_cuda) {
...
@@ -55,19 +55,26 @@ inline void PerceptionFreeHost(void* ptr, bool use_cuda) {
*/
*/
class
SyncedMemory
{
class
SyncedMemory
{
public:
public:
enum
SyncedHead
{
UNINITIALIZED
,
HEAD_AT_CPU
,
HEAD_AT_GPU
,
SYNCED
};
explicit
SyncedMemory
(
bool
use_cuda
);
explicit
SyncedMemory
(
bool
use_cuda
);
explicit
SyncedMemory
(
size_t
size
,
bool
use_cuda
);
explicit
SyncedMemory
(
size_t
size
,
bool
use_cuda
);
SyncedMemory
(
const
SyncedMemory
&
)
=
delete
;
SyncedMemory
(
const
SyncedMemory
&
)
=
delete
;
void
operator
=
(
const
SyncedMemory
&
)
=
delete
;
void
operator
=
(
const
SyncedMemory
&
)
=
delete
;
~
SyncedMemory
();
~
SyncedMemory
();
const
void
*
cpu_data
();
const
void
*
cpu_data
();
void
set_cpu_data
(
void
*
data
);
void
set_cpu_data
(
void
*
data
);
const
void
*
gpu_data
();
const
void
*
gpu_data
();
void
set_gpu_data
(
void
*
data
);
void
set_gpu_data
(
void
*
data
);
void
*
mutable_cpu_data
();
void
*
mutable_cpu_data
();
void
*
mutable_gpu_data
();
void
*
mutable_gpu_data
();
enum
SyncedHead
{
UNINITIALIZED
,
HEAD_AT_CPU
,
HEAD_AT_GPU
,
SYNCED
};
SyncedHead
head
()
const
{
return
head_
;
}
SyncedHead
head
()
const
{
return
head_
;
}
void
set_head
(
SyncedHead
head
)
{
head_
=
head
;
}
void
set_head
(
SyncedHead
head
)
{
head_
=
head
;
}
void
set_head_gpu
()
{
set_head
(
HEAD_AT_GPU
);
}
void
set_head_gpu
()
{
set_head
(
HEAD_AT_GPU
);
}
...
@@ -80,9 +87,10 @@ class SyncedMemory {
...
@@ -80,9 +87,10 @@ class SyncedMemory {
private:
private:
void
check_device
();
void
check_device
();
void
to_cpu
();
void
to_cpu
();
void
to_gpu
();
void
to_gpu
();
private:
void
*
cpu_ptr_
;
void
*
cpu_ptr_
;
void
*
gpu_ptr_
;
void
*
gpu_ptr_
;
size_t
size_
;
size_t
size_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录