Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
8777ff3f
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8777ff3f
编写于
12月 13, 2016
作者:
Y
Yi Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use yapf to auto format all BUILD and WORKSPACE files
上级
6a989170
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
60 addition
and
102 deletion
+60
-102
WORKSPACE
WORKSPACE
+3
-4
paddle/cuda/src/hl_cuda_device.cc
paddle/cuda/src/hl_cuda_device.cc
+1
-1
third_party/gflags_test/BUILD
third_party/gflags_test/BUILD
+5
-6
third_party/gflags_test/gflags_test.cc
third_party/gflags_test/gflags_test.cc
+3
-6
third_party/glog.BUILD
third_party/glog.BUILD
+35
-63
third_party/glog_test/BUILD
third_party/glog_test/BUILD
+5
-6
third_party/glog_test/glog_test.cc
third_party/glog_test/glog_test.cc
+1
-3
third_party/gtest.BUILD
third_party/gtest.BUILD
+7
-13
未找到文件。
WORKSPACE
浏览文件 @
8777ff3f
...
...
@@ -3,7 +3,7 @@ http_archive(
name
=
"protobuf"
,
url
=
"http://github.com/google/protobuf/archive/v3.1.0.tar.gz"
,
sha256
=
"0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7"
,
strip_prefix
=
"protobuf-3.1.0"
,
)
strip_prefix
=
"protobuf-3.1.0"
)
# External dependency to gtest 1.7.0. This method comes from
# https://www.bazel.io/versions/master/docs/tutorial/cpp.html.
...
...
@@ -12,7 +12,7 @@ new_http_archive(
url
=
"https://github.com/google/googletest/archive/release-1.7.0.zip"
,
sha256
=
"b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0"
,
build_file
=
"third_party/gtest.BUILD"
,
strip_prefix
=
"googletest-release-1.7.0"
,
)
strip_prefix
=
"googletest-release-1.7.0"
)
# External dependency to gflags. This method comes from
# https://github.com/gflags/example/blob/master/WORKSPACE.
...
...
@@ -20,8 +20,7 @@ new_git_repository(
name
=
"gflags"
,
tag
=
"v2.2.0"
,
remote
=
"https://github.com/gflags/gflags.git"
,
build_file
=
"third_party/gflags.BUILD"
,
)
build_file
=
"third_party/gflags.BUILD"
)
# External dependency to glog. This method comes from
# https://github.com/reyoung/bazel_playground/blob/master/WORKSPACE
...
...
paddle/cuda/src/hl_cuda_device.cc
浏览文件 @
8777ff3f
...
...
@@ -12,13 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "hl_cuda.h"
#include <cuda_profiler_api.h>
#include <string.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <unistd.h>
#include <mutex>
#include "hl_cuda.h"
#include "hl_cuda.ph"
#include "hl_dso_loader.h"
#include "hl_thread.ph"
...
...
third_party/gflags_test/BUILD
浏览文件 @
8777ff3f
licenses
([
"notice"
])
# Apache 2.0
cc_test
(
name
=
"gflags_test"
,
srcs
=
[
"gflags_test.cc"
],
copts
=
[
"-Iexternal/gtest/include"
],
deps
=
[
name
=
"gflags_test"
,
srcs
=
[
"gflags_test.cc"
],
copts
=
[
"-Iexternal/gtest/include"
],
deps
=
[
"@gtest//:gtest"
,
"@gflags//:gflags"
,
],
)
],
)
third_party/gflags_test/gflags_test.cc
浏览文件 @
8777ff3f
...
...
@@ -4,17 +4,14 @@
#include "gflags/gflags.h"
#include "gtest/gtest.h"
DEFINE_bool
(
verbose
,
false
,
"Display program name before message"
);
DEFINE_string
(
message
,
"Hello world!"
,
"Message to print"
);
static
bool
IsNonEmptyMessage
(
const
char
*
flagname
,
const
std
::
string
&
value
)
{
static
bool
IsNonEmptyMessage
(
const
char
*
flagname
,
const
std
::
string
&
value
)
{
return
value
[
0
]
!=
'\0'
;
}
DEFINE_validator
(
message
,
&
IsNonEmptyMessage
);
namespace
third_party
{
namespace
gflags_test
{
...
...
@@ -23,10 +20,10 @@ TEST(GflagsTest, ParseAndPrint) {
gflags
::
SetVersionString
(
"1.0.0"
);
int
argc
=
1
;
char
program_name
[]
=
"gflags_test"
;
char
**
argv
=
new
char
*
[
2
];
char
**
argv
=
new
char
*
[
2
];
argv
[
0
]
=
program_name
;
argv
[
1
]
=
NULL
;
gflags
::
ParseCommandLineFlags
(
&
argc
,
reinterpret_cast
<
char
***>
(
&
argv
),
true
);
gflags
::
ParseCommandLineFlags
(
&
argc
,
reinterpret_cast
<
char
***>
(
&
argv
),
true
);
EXPECT_EQ
(
"gflags_test"
,
std
::
string
(
gflags
::
ProgramInvocationShortName
()));
EXPECT_EQ
(
"Hello world!"
,
FLAGS_message
);
gflags
::
ShutDownCommandLineFlags
();
...
...
third_party/glog.BUILD
浏览文件 @
8777ff3f
licenses(["notice"])
cc_library(
visibility
=
["//visibility:public"],
name
=
"glog",
includes
=
[
visibility
=
["//visibility:public"],
name
=
"glog",
includes
=
[
".",
"src",
],
copts
=
[
copts
=
[
"-D_START_GOOGLE_NAMESPACE_='namespace google {'",
"-D_END_GOOGLE_NAMESPACE_='}'",
"-DGOOGLE_NAMESPACE='google'",
...
...
@@ -45,7 +45,7 @@ cc_library(
#"-fno-sanitize=address",
"-Iexternal/glog/src",
],
srcs
=
[
srcs
=
[
"src/demangle.cc",
"src/logging.cc",
"src/raw_logging.cc",
...
...
@@ -59,7 +59,7 @@ cc_library(
":stl_logging_h",
":vlog_is_on_h",
],
hdrs
=
[
hdrs
=
[
"src/demangle.h",
"src/mock-log.h",
"src/stacktrace.h",
...
...
@@ -69,74 +69,47 @@ cc_library(
"src/base/googleinit.h",
"src/base/mutex.h",
"src/glog/log_severity.h",
],
)
])
genrule(
name = "config_h",
srcs = [
"src/config.h.cmake.in",
],
outs = [
"config.h",
],
cmd = "awk '{ gsub(/^#cmakedefine/, \"//cmakedefine\"); print; }' $(<) > $(@)",
name="config_h",
srcs=["src/config.h.cmake.in"],
outs=["config.h"],
cmd="awk '{ gsub(/^#cmakedefine/, \"//cmakedefine\"); print; }' $(<) > $(@)",
)
genrule(
name = "logging_h",
srcs = [
"src/glog/logging.h.in",
],
outs = [
"glog/logging.h",
],
cmd = "$(location :gen_sh) < $(<) > $(@)",
tools = [":gen_sh"],
)
name="logging_h",
srcs=["src/glog/logging.h.in"],
outs=["glog/logging.h"],
cmd="$(location :gen_sh) < $(<) > $(@)",
tools=[":gen_sh"])
genrule(
name = "raw_logging_h",
srcs = [
"src/glog/raw_logging.h.in",
],
outs = [
"glog/raw_logging.h",
],
cmd = "$(location :gen_sh) < $(<) > $(@)",
tools = [":gen_sh"],
)
name="raw_logging_h",
srcs=["src/glog/raw_logging.h.in"],
outs=["glog/raw_logging.h"],
cmd="$(location :gen_sh) < $(<) > $(@)",
tools=[":gen_sh"])
genrule(
name = "stl_logging_h",
srcs = [
"src/glog/stl_logging.h.in",
],
outs = [
"glog/stl_logging.h",
],
cmd = "$(location :gen_sh) < $(<) > $(@)",
tools = [":gen_sh"],
)
name="stl_logging_h",
srcs=["src/glog/stl_logging.h.in"],
outs=["glog/stl_logging.h"],
cmd="$(location :gen_sh) < $(<) > $(@)",
tools=[":gen_sh"])
genrule(
name = "vlog_is_on_h",
srcs = [
"src/glog/vlog_is_on.h.in",
],
outs = [
"glog/vlog_is_on.h",
],
cmd = "$(location :gen_sh) < $(<) > $(@)",
tools = [":gen_sh"],
)
name="vlog_is_on_h",
srcs=["src/glog/vlog_is_on.h.in"],
outs=["glog/vlog_is_on.h"],
cmd="$(location :gen_sh) < $(<) > $(@)",
tools=[":gen_sh"])
genrule(
name = "gen_sh",
outs = [
"gen.sh",
],
cmd = """
name="gen_sh",
outs=["gen.sh"],
cmd="""
cat > $@ <<"EOF"
#! /bin/sh
sed -e 's/@ac_cv_have_unistd_h@/1/g' \
...
...
@@ -152,5 +125,4 @@ sed -e 's/@ac_cv_have_unistd_h@/1/g' \
-e 's/@ac_cv___attribute___noinline@/__attribute__((noinline))/g' \
-e 's/@ac_cv___attribute___noreturn@/__attribute__((noreturn))/g' \
-e 's/@ac_cv___attribute___printf_4_5@/__attribute__((__format__ (__printf__, 4, 5)))/g'
EOF"""
)
EOF""")
third_party/glog_test/BUILD
浏览文件 @
8777ff3f
licenses
([
"notice"
])
# Apache 2.0
cc_test
(
name
=
"glog_test"
,
srcs
=
[
"glog_test.cc"
],
copts
=
[
"-Iexternal/gtest/include"
],
deps
=
[
name
=
"glog_test"
,
srcs
=
[
"glog_test.cc"
],
copts
=
[
"-Iexternal/gtest/include"
],
deps
=
[
"@gtest//:gtest"
,
"@glog//:glog"
,
],
)
],
)
third_party/glog_test/glog_test.cc
浏览文件 @
8777ff3f
...
...
@@ -4,6 +4,4 @@
#include "glog/logging.h"
#include "gtest/gtest.h"
TEST
(
GlogTest
,
Logging
)
{
LOG
(
INFO
)
<<
"Hello world"
;
}
TEST
(
GlogTest
,
Logging
)
{
LOG
(
INFO
)
<<
"Hello world"
;
}
third_party/gtest.BUILD
浏览文件 @
8777ff3f
cc_library(
name = "gtest",
srcs = glob(
["src/*.cc"],
exclude = ["src/gtest-all.cc"]
),
hdrs = glob([
"include/**/*.h",
"src/*.h"
]),
copts = ["-Iexternal/gtest/include"],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
)
name="gtest",
srcs=glob(
["src/*.cc"], exclude=["src/gtest-all.cc"]),
hdrs=glob(["include/**/*.h", "src/*.h"]),
copts=["-Iexternal/gtest/include"],
linkopts=["-pthread"],
visibility=["//visibility:public"], )
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录