Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
a238b11f
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a238b11f
编写于
9月 13, 2016
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix linux compile
上级
d9870c35
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
11 deletion
+14
-11
cmake/util.cmake
cmake/util.cmake
+3
-2
paddle/math/Allocator.h
paddle/math/Allocator.h
+1
-1
paddle/math/tests/test_SIMDFunctions.cpp
paddle/math/tests/test_SIMDFunctions.cpp
+1
-1
paddle/parameter/tests/test_common.cpp
paddle/parameter/tests/test_common.cpp
+5
-3
paddle/utils/Stat.cpp
paddle/utils/Stat.cpp
+1
-1
paddle/utils/arch/linux/Locks.cpp
paddle/utils/arch/linux/Locks.cpp
+3
-3
未找到文件。
cmake/util.cmake
浏览文件 @
a238b11f
...
@@ -104,9 +104,10 @@ function(link_paddle_exe TARGET_NAME)
...
@@ -104,9 +104,10 @@ function(link_paddle_exe TARGET_NAME)
${
PROTOBUF_LIBRARY
}
${
PROTOBUF_LIBRARY
}
${
CMAKE_THREAD_LIBS_INIT
}
${
CMAKE_THREAD_LIBS_INIT
}
${
CBLAS_LIBS
}
${
CBLAS_LIBS
}
${
CMAKE_DL_LIBS
}
${
INTERAL_LIBS
}
${
INTERAL_LIBS
}
${
ZLIB_LIBRARIES
}
)
${
ZLIB_LIBRARIES
}
${
CMAKE_DL_LIBS
}
)
if
(
WITH_PYTHON
)
if
(
WITH_PYTHON
)
target_link_libraries
(
${
TARGET_NAME
}
target_link_libraries
(
${
TARGET_NAME
}
...
...
paddle/math/Allocator.h
浏览文件 @
a238b11f
...
@@ -49,7 +49,7 @@ public:
...
@@ -49,7 +49,7 @@ public:
*/
*/
virtual
void
*
alloc
(
size_t
size
)
{
virtual
void
*
alloc
(
size_t
size
)
{
void
*
ptr
;
void
*
ptr
;
posix_memalign
(
&
ptr
,
32ul
,
size
);
CHECK_EQ
(
posix_memalign
(
&
ptr
,
32ul
,
size
),
0
);
CHECK
(
ptr
)
<<
"Fail to allocate CPU memory: size="
<<
size
;
CHECK
(
ptr
)
<<
"Fail to allocate CPU memory: size="
<<
size
;
return
ptr
;
return
ptr
;
}
}
...
...
paddle/math/tests/test_SIMDFunctions.cpp
浏览文件 @
a238b11f
...
@@ -38,7 +38,7 @@ static std::mt19937 RandomEngine(time(0));
...
@@ -38,7 +38,7 @@ static std::mt19937 RandomEngine(time(0));
inline
static
std
::
unique_ptr
<
float
[]
>
NewVector
(
size_t
len
=
VECTOR_LEN
,
inline
static
std
::
unique_ptr
<
float
[]
>
NewVector
(
size_t
len
=
VECTOR_LEN
,
size_t
align
=
ALIGN
)
{
size_t
align
=
ALIGN
)
{
float
*
ptr
;
float
*
ptr
;
posix_memalign
((
void
**
)
&
ptr
,
align
,
len
*
sizeof
(
float
)
);
CHECK_EQ
(
posix_memalign
((
void
**
)
&
ptr
,
align
,
len
*
sizeof
(
float
)),
0
);
return
std
::
unique_ptr
<
float
[]
>
(
ptr
);
return
std
::
unique_ptr
<
float
[]
>
(
ptr
);
}
}
...
...
paddle/parameter/tests/test_common.cpp
浏览文件 @
a238b11f
...
@@ -125,9 +125,11 @@ TEST_F(CommonTest, sgdUpdate) {
...
@@ -125,9 +125,11 @@ TEST_F(CommonTest, sgdUpdate) {
const
size_t
alignHeader
[]
=
{
0
,
2
,
3
,
5
,
7
,
8
};
const
size_t
alignHeader
[]
=
{
0
,
2
,
3
,
5
,
7
,
8
};
for
(
auto
&
size
:
sizeVec_
)
{
for
(
auto
&
size
:
sizeVec_
)
{
real
*
gradientBuffer
,
*
valueBuffer
,
*
momentumBuffer
;
real
*
gradientBuffer
,
*
valueBuffer
,
*
momentumBuffer
;
posix_memalign
((
void
**
)
&
gradientBuffer
,
32
,
sizeof
(
real
)
*
size
);
CHECK_EQ
(
posix_memalign
((
void
**
)
&
gradientBuffer
,
32
,
sizeof
(
real
)
*
size
),
posix_memalign
((
void
**
)
&
valueBuffer
,
32
,
sizeof
(
real
)
*
size
);
0
);
posix_memalign
((
void
**
)
&
momentumBuffer
,
32
,
sizeof
(
real
)
*
size
);
CHECK_EQ
(
posix_memalign
((
void
**
)
&
valueBuffer
,
32
,
sizeof
(
real
)
*
size
),
0
);
CHECK_EQ
(
posix_memalign
((
void
**
)
&
momentumBuffer
,
32
,
sizeof
(
real
)
*
size
),
0
);
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
{
gradientBuffer
[
i
]
=
1.0
;
gradientBuffer
[
i
]
=
1.0
;
...
...
paddle/utils/Stat.cpp
浏览文件 @
a238b11f
...
@@ -25,7 +25,7 @@ namespace paddle {
...
@@ -25,7 +25,7 @@ namespace paddle {
pid_t
getTID
()
{
pid_t
getTID
()
{
#if defined(__APPLE__) || defined(__OSX__)
#if defined(__APPLE__) || defined(__OSX__)
pid_t
tid
=
syscall
(
SYS_thread_selfid
);
pid_t
tid
=
syscall
(
SYS_thread_selfid
);
#el
if defined(__LINUX__)
#el
se
#ifndef __NR_gettid
#ifndef __NR_gettid
#define __NR_gettid 224
#define __NR_gettid 224
#endif
#endif
...
...
paddle/utils/arch/linux/Locks.cpp
浏览文件 @
a238b11f
...
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#include "paddle/util/Locks.h"
#include "paddle/util
s
/Locks.h"
#include <semaphore.h>
#include <semaphore.h>
#include <unistd.h>
#include <unistd.h>
...
@@ -35,7 +35,7 @@ bool Semaphore::timeWait(struct timespec* ts) {
...
@@ -35,7 +35,7 @@ bool Semaphore::timeWait(struct timespec* ts) {
}
}
void
Semaphore
::
wait
()
{
void
Semaphore
::
wait
()
{
sem_wait
(
&
m
->
sem
);
sem_wait
(
&
m
->
sem
);
}
}
void
Semaphore
::
post
()
{
void
Semaphore
::
post
()
{
...
@@ -82,4 +82,4 @@ void ThreadBarrier::wait() {
...
@@ -82,4 +82,4 @@ void ThreadBarrier::wait() {
pthread_barrier_wait
(
&
m
->
barrier_
);
pthread_barrier_wait
(
&
m
->
barrier_
);
}
}
}
// namespace paddle
}
// namespace paddle
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录