Commit 7149650f authored by Minjie Wang's avatar Minjie Wang Committed by Zihao Ye
Browse files

Fix mac compilation (#618)

parent 5da57663
...@@ -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]);
......
...@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment