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
7149650f
Commit
7149650f
authored
Jun 07, 2019
by
Minjie Wang
Committed by
Zihao Ye
Jun 07, 2019
Browse files
Fix mac compilation (#618)
parent
5da57663
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
include/dgl/immutable_graph.h
include/dgl/immutable_graph.h
+3
-3
src/c_api_common.h
src/c_api_common.h
+0
-2
No files found.
include/dgl/immutable_graph.h
View file @
7149650f
...
@@ -91,7 +91,7 @@ class CSR : public GraphInterface {
...
@@ -91,7 +91,7 @@ class CSR : public GraphInterface {
}
}
bool
HasVertex
(
dgl_id_t
vid
)
const
override
{
bool
HasVertex
(
dgl_id_t
vid
)
const
override
{
return
vid
<
NumVertices
()
&&
vid
>=
0
;
return
vid
<
NumVertices
();
}
}
bool
HasEdgeBetween
(
dgl_id_t
src
,
dgl_id_t
dst
)
const
override
;
bool
HasEdgeBetween
(
dgl_id_t
src
,
dgl_id_t
dst
)
const
override
;
...
@@ -311,7 +311,7 @@ class COO : public GraphInterface {
...
@@ -311,7 +311,7 @@ class COO : public GraphInterface {
}
}
bool
HasVertex
(
dgl_id_t
vid
)
const
override
{
bool
HasVertex
(
dgl_id_t
vid
)
const
override
{
return
vid
<
NumVertices
()
&&
vid
>=
0
;
return
vid
<
NumVertices
();
}
}
bool
HasEdgeBetween
(
dgl_id_t
src
,
dgl_id_t
dst
)
const
override
{
bool
HasEdgeBetween
(
dgl_id_t
src
,
dgl_id_t
dst
)
const
override
{
...
@@ -345,7 +345,7 @@ class COO : public GraphInterface {
...
@@ -345,7 +345,7 @@ class COO : public GraphInterface {
}
}
std
::
pair
<
dgl_id_t
,
dgl_id_t
>
FindEdge
(
dgl_id_t
eid
)
const
override
{
std
::
pair
<
dgl_id_t
,
dgl_id_t
>
FindEdge
(
dgl_id_t
eid
)
const
override
{
CHECK
(
eid
<
NumEdges
()
&&
eid
>=
0
)
<<
"Invalid edge id: "
<<
eid
;
CHECK
(
eid
<
NumEdges
())
<<
"Invalid edge id: "
<<
eid
;
const
dgl_id_t
*
src_data
=
static_cast
<
dgl_id_t
*>
(
src_
->
data
);
const
dgl_id_t
*
src_data
=
static_cast
<
dgl_id_t
*>
(
src_
->
data
);
const
dgl_id_t
*
dst_data
=
static_cast
<
dgl_id_t
*>
(
dst_
->
data
);
const
dgl_id_t
*
dst_data
=
static_cast
<
dgl_id_t
*>
(
dst_
->
data
);
return
std
::
make_pair
(
src_data
[
eid
],
dst_data
[
eid
]);
return
std
::
make_pair
(
src_data
[
eid
],
dst_data
[
eid
]);
...
...
src/c_api_common.h
View file @
7149650f
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
#include <algorithm>
#include <algorithm>
#include <vector>
#include <vector>
namespace
{
/*! \brief Check whether two device contexts are the same.*/
/*! \brief Check whether two device contexts are the same.*/
inline
bool
operator
==
(
const
DLContext
&
ctx1
,
const
DLContext
&
ctx2
)
{
inline
bool
operator
==
(
const
DLContext
&
ctx1
,
const
DLContext
&
ctx2
)
{
return
ctx1
.
device_type
==
ctx2
.
device_type
&&
ctx1
.
device_id
==
ctx2
.
device_id
;
return
ctx1
.
device_type
==
ctx2
.
device_type
&&
ctx1
.
device_id
==
ctx2
.
device_id
;
...
@@ -22,7 +21,6 @@ inline bool operator == (const DLContext& ctx1, const DLContext& ctx2) {
...
@@ -22,7 +21,6 @@ inline bool operator == (const DLContext& ctx1, const DLContext& ctx2) {
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
DLContext
&
ctx
)
{
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
DLContext
&
ctx
)
{
return
os
<<
""
<<
ctx
.
device_type
<<
":"
<<
ctx
.
device_id
<<
""
;
return
os
<<
""
<<
ctx
.
device_type
<<
":"
<<
ctx
.
device_id
<<
""
;
}
}
}
// namespace
namespace
dgl
{
namespace
dgl
{
...
...
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