Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
820c6b9e
Commit
820c6b9e
authored
Oct 18, 2018
by
Minjie Wang
Browse files
Add lint script and fix cpplint errors
parent
3e76bcc0
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
48 additions
and
35 deletions
+48
-35
src/runtime/file_util.h
src/runtime/file_util.h
+3
-3
src/runtime/meta_data.h
src/runtime/meta_data.h
+3
-3
src/runtime/module_util.h
src/runtime/module_util.h
+3
-3
src/runtime/pack_args.h
src/runtime/pack_args.h
+3
-3
src/runtime/runtime_base.h
src/runtime/runtime_base.h
+3
-3
src/runtime/thread_storage_scope.h
src/runtime/thread_storage_scope.h
+3
-3
src/runtime/workspace_pool.h
src/runtime/workspace_pool.h
+3
-3
src/scheduler/scheduler.cc
src/scheduler/scheduler.cc
+14
-11
src/scheduler/scheduler_apis.cc
src/scheduler/scheduler_apis.cc
+8
-3
tests/scripts/task_lint.sh
tests/scripts/task_lint.sh
+5
-0
No files found.
src/runtime/file_util.h
View file @
820c6b9e
...
...
@@ -3,8 +3,8 @@
* \file file_util.h
* \brief Minimum file manipulation util for runtime.
*/
#ifndef
TVM
_RUNTIME_FILE_UTIL_H_
#define
TVM
_RUNTIME_FILE_UTIL_H_
#ifndef
DGL
_RUNTIME_FILE_UTIL_H_
#define
DGL
_RUNTIME_FILE_UTIL_H_
#include <string>
#include "meta_data.h"
...
...
@@ -73,4 +73,4 @@ void LoadMetaDataFromFile(
std
::
unordered_map
<
std
::
string
,
FunctionInfo
>*
fmap
);
}
// namespace runtime
}
// namespace tvm
#endif //
TVM
_RUNTIME_FILE_UTIL_H_
#endif //
DGL
_RUNTIME_FILE_UTIL_H_
src/runtime/meta_data.h
View file @
820c6b9e
...
...
@@ -3,8 +3,8 @@
* \file meta_data.h
* \brief Meta data related utilities
*/
#ifndef
TVM
_RUNTIME_META_DATA_H_
#define
TVM
_RUNTIME_META_DATA_H_
#ifndef
DGL
_RUNTIME_META_DATA_H_
#define
DGL
_RUNTIME_META_DATA_H_
#include <dmlc/json.h>
#include <dmlc/io.h>
...
...
@@ -33,4 +33,4 @@ struct FunctionInfo {
namespace
dmlc
{
DMLC_DECLARE_TRAITS
(
has_saveload
,
::
tvm
::
runtime
::
FunctionInfo
,
true
);
}
// namespace dmlc
#endif //
TVM
_RUNTIME_META_DATA_H_
#endif //
DGL
_RUNTIME_META_DATA_H_
src/runtime/module_util.h
View file @
820c6b9e
...
...
@@ -3,8 +3,8 @@
* \file module_util.h
* \brief Helper utilities for module building
*/
#ifndef
TVM
_RUNTIME_MODULE_UTIL_H_
#define
TVM
_RUNTIME_MODULE_UTIL_H_
#ifndef
DGL
_RUNTIME_MODULE_UTIL_H_
#define
DGL
_RUNTIME_MODULE_UTIL_H_
#include <dgl/runtime/module.h>
#include <dgl/runtime/c_runtime_api.h>
...
...
@@ -58,4 +58,4 @@ void InitContextFunctions(FLookup flookup) {
}
}
// namespace runtime
}
// namespace tvm
#endif //
TVM
_RUNTIME_MODULE_UTIL_H_
#endif //
DGL
_RUNTIME_MODULE_UTIL_H_
src/runtime/pack_args.h
View file @
820c6b9e
...
...
@@ -10,8 +10,8 @@
* union_32bit args[N], int num_args);
* - Pack buffer by address, pack rest parameter into 32bit union buffer.
*/
#ifndef
TVM
_RUNTIME_PACK_ARGS_H_
#define
TVM
_RUNTIME_PACK_ARGS_H_
#ifndef
DGL
_RUNTIME_PACK_ARGS_H_
#define
DGL
_RUNTIME_PACK_ARGS_H_
#include <dgl/runtime/c_runtime_api.h>
#include <vector>
...
...
@@ -307,4 +307,4 @@ inline PackedFunc PackFuncPackedArg(F f, const std::vector<TVMType>& arg_types)
}
}
// namespace runtime
}
// namespace tvm
#endif //
TVM
_RUNTIME_PACK_ARGS_H_
#endif //
DGL
_RUNTIME_PACK_ARGS_H_
src/runtime/runtime_base.h
View file @
820c6b9e
...
...
@@ -3,8 +3,8 @@
* \file runtime_base.h
* \brief Base of all C APIs
*/
#ifndef
TVM
_RUNTIME_RUNTIME_BASE_H_
#define
TVM
_RUNTIME_RUNTIME_BASE_H_
#ifndef
DGL
_RUNTIME_RUNTIME_BASE_H_
#define
DGL
_RUNTIME_RUNTIME_BASE_H_
#include <dgl/runtime/c_runtime_api.h>
#include <stdexcept>
...
...
@@ -31,4 +31,4 @@ inline int TVMAPIHandleException(const std::runtime_error &e) {
return
-
1
;
}
#endif //
TVM
_RUNTIME_RUNTIME_BASE_H_
#endif //
DGL
_RUNTIME_RUNTIME_BASE_H_
src/runtime/thread_storage_scope.h
View file @
820c6b9e
...
...
@@ -3,8 +3,8 @@
* \file thread_storage_scope.h
* \brief Extract thread axis configuration from TVMArgs.
*/
#ifndef
TVM
_RUNTIME_THREAD_STORAGE_SCOPE_H_
#define
TVM
_RUNTIME_THREAD_STORAGE_SCOPE_H_
#ifndef
DGL
_RUNTIME_THREAD_STORAGE_SCOPE_H_
#define
DGL
_RUNTIME_THREAD_STORAGE_SCOPE_H_
#include <dgl/runtime/packed_func.h>
#include <string>
...
...
@@ -204,4 +204,4 @@ struct hash<::tvm::runtime::StorageScope> {
}
};
}
// namespace std
#endif //
TVM
_RUNTIME_THREAD_STORAGE_SCOPE_H_
#endif //
DGL
_RUNTIME_THREAD_STORAGE_SCOPE_H_
src/runtime/workspace_pool.h
View file @
820c6b9e
...
...
@@ -3,8 +3,8 @@
* \file workspace_pool.h
* \brief Workspace pool utility.
*/
#ifndef
TVM
_RUNTIME_WORKSPACE_POOL_H_
#define
TVM
_RUNTIME_WORKSPACE_POOL_H_
#ifndef
DGL
_RUNTIME_WORKSPACE_POOL_H_
#define
DGL
_RUNTIME_WORKSPACE_POOL_H_
#include <dgl/runtime/device_api.h>
#include <vector>
...
...
@@ -58,4 +58,4 @@ class WorkspacePool {
}
// namespace runtime
}
// namespace tvm
#endif //
TVM
_RUNTIME_WORKSPACE_POOL_H_
#endif //
DGL
_RUNTIME_WORKSPACE_POOL_H_
src/scheduler/scheduler.cc
View file @
820c6b9e
// DGL Scheduler implementation
/*!
* Copyright (c) 2018 by Contributors
* \file scheduler/scheduler.cc
* \brief DGL Scheduler implementation
*/
#include <dgl/scheduler.h>
#include <unordered_map>
#include <vector>
#include <dgl/scheduler.h>
namespace
dgl
{
namespace
sched
{
...
...
@@ -19,7 +22,7 @@ std::vector<IdArray> DegreeBucketing(const IdArray& vids) {
// bkt: deg->dsts
std
::
unordered_map
<
int64_t
,
std
::
vector
<
int64_t
>>
bkt
;
for
(
auto
&
it
:
in_edges
)
{
for
(
const
auto
&
it
:
in_edges
)
{
bkt
[
it
.
second
.
size
()].
push_back
(
it
.
first
);
}
...
...
@@ -38,15 +41,15 @@ std::vector<IdArray> DegreeBucketing(const IdArray& vids) {
int64_t
*
msec_ptr
=
static_cast
<
int64_t
*>
(
mid_section
->
data
);
// fill in bucketing ordering
for
(
auto
&
it
:
bkt
)
{
// for each bucket
int64_t
deg
=
it
.
first
;
int64_t
n_dst
=
it
.
second
.
size
();
for
(
const
auto
&
it
:
bkt
)
{
// for each bucket
const
int64_t
deg
=
it
.
first
;
const
int64_t
n_dst
=
it
.
second
.
size
();
*
deg_ptr
++
=
deg
;
*
nsec_ptr
++
=
n_dst
;
*
msec_ptr
++
=
deg
*
n_dst
;
for
(
auto
dst
:
it
.
second
)
{
// for each dst in this bucket
for
(
const
auto
dst
:
it
.
second
)
{
// for each dst in this bucket
*
nid_ptr
++
=
dst
;
for
(
auto
mid
:
in_edges
[
dst
])
{
// for each in edge of dst
for
(
const
auto
mid
:
in_edges
[
dst
])
{
// for each in edge of dst
*
mid_ptr
++
=
mid
;
}
}
...
...
@@ -62,6 +65,6 @@ std::vector<IdArray> DegreeBucketing(const IdArray& vids) {
return
std
::
move
(
ret
);
}
}
// namespace sched
}
// namespace sched
}
// namespace dgl
}
// namespace dgl
src/scheduler/scheduler_apis.cc
View file @
820c6b9e
#include "../c_api_common.h"
/*!
* Copyright (c) 2018 by Contributors
* \file scheduler/scheduler_apis.cc
* \brief DGL scheduler APIs
*/
#include <dgl/graph.h>
#include <dgl/scheduler.h>
#include "../c_api_common.h"
using
tvm
::
runtime
::
TVMArgs
;
using
tvm
::
runtime
::
TVMRetValue
;
...
...
@@ -18,8 +23,8 @@ TVM_REGISTER_GLOBAL("scheduler._CAPI_DGLDegreeBucketingFromGraph")
.
set_body
([]
(
TVMArgs
args
,
TVMRetValue
*
rv
)
{
GraphHandle
ghandle
=
args
[
0
];
const
Graph
*
gptr
=
static_cast
<
Graph
*>
(
ghandle
);
auto
edges
=
gptr
->
Edges
(
false
);
const
auto
&
edges
=
gptr
->
Edges
(
false
);
*
rv
=
ConvertNDArrayVectorToPackedFunc
(
sched
::
DegreeBucketing
(
edges
.
dst
));
});
}
// namespace dgl
}
// namespace dgl
tests/scripts/task_lint.sh
0 → 100755
View file @
820c6b9e
#!/bin/sh
# cpplint
echo
'Checking code style of C++ codes...'
python3 third_party/dmlc-core/scripts/lint.py dgl cpp include src
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment