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
5185c522
Unverified
Commit
5185c522
authored
Dec 04, 2023
by
Muhammed Fatih BALIN
Committed by
GitHub
Dec 04, 2023
Browse files
[Misc] Eliminate compile warnings (#6685)
parent
15d05be3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
graphbolt/src/macro.h
graphbolt/src/macro.h
+1
-1
src/array/libra_partition.cc
src/array/libra_partition.cc
+1
-1
src/graph/transform/compact.cc
src/graph/transform/compact.cc
+1
-1
tests/cpp/test_partition.cc
tests/cpp/test_partition.cc
+4
-4
No files found.
graphbolt/src/macro.h
View file @
5185c522
...
@@ -15,7 +15,7 @@ namespace graphbolt {
...
@@ -15,7 +15,7 @@ namespace graphbolt {
#ifdef GRAPHBOLT_USE_CUDA
#ifdef GRAPHBOLT_USE_CUDA
#define GRAPHBOLT_DISPATCH_CUDA_ONLY_DEVICE(device_type, name, ...) \
#define GRAPHBOLT_DISPATCH_CUDA_ONLY_DEVICE(device_type, name, ...) \
if (device_type == c10::DeviceType::CUDA) { \
if (device_type == c10::DeviceType::CUDA) { \
const
auto XPU = c10::DeviceType::CUDA;
\
[[maybe_unused]]
auto XPU = c10::DeviceType::CUDA; \
__VA_ARGS__ \
__VA_ARGS__ \
} else { \
} else { \
TORCH_CHECK(false, name, " is only available on CUDA device."); \
TORCH_CHECK(false, name, " is only available on CUDA device."); \
...
...
src/array/libra_partition.cc
View file @
5185c522
...
@@ -295,7 +295,7 @@ void LibraVertexCut(
...
@@ -295,7 +295,7 @@ void LibraVertexCut(
for
(
int64_t
c
=
0
;
c
<
nc
;
c
++
)
printf
(
"%ld "
,
community_edges
[
c
]);
for
(
int64_t
c
=
0
;
c
<
nc
;
c
++
)
printf
(
"%ld "
,
community_edges
[
c
]);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
delete
community_edges
;
delete
[]
community_edges
;
fclose
(
fp
);
fclose
(
fp
);
}
}
...
...
src/graph/transform/compact.cc
View file @
5185c522
...
@@ -182,7 +182,7 @@ DGL_REGISTER_GLOBAL("transform._CAPI_DGLCompactGraphs")
...
@@ -182,7 +182,7 @@ DGL_REGISTER_GLOBAL("transform._CAPI_DGLCompactGraphs")
List
<
HeteroGraphRef
>
compacted_graph_refs
;
List
<
HeteroGraphRef
>
compacted_graph_refs
;
List
<
Value
>
induced_nodes
;
List
<
Value
>
induced_nodes
;
for
(
const
HeteroGraphPtr
g
:
result_pair
.
first
)
for
(
const
HeteroGraphPtr
&
g
:
result_pair
.
first
)
compacted_graph_refs
.
push_back
(
HeteroGraphRef
(
g
));
compacted_graph_refs
.
push_back
(
HeteroGraphRef
(
g
));
for
(
const
IdArray
&
ids
:
result_pair
.
second
)
for
(
const
IdArray
&
ids
:
result_pair
.
second
)
induced_nodes
.
push_back
(
Value
(
MakeValue
(
ids
)));
induced_nodes
.
push_back
(
Value
(
MakeValue
(
ids
)));
...
...
tests/cpp/test_partition.cc
View file @
5185c522
...
@@ -61,7 +61,7 @@ void _TestRemainder_MapToX() {
...
@@ -61,7 +61,7 @@ void _TestRemainder_MapToX() {
// every global index should have the same remainder as the part id
// every global index should have the same remainder as the part id
ASSERT_EQ
(
global
->
shape
[
0
],
local
->
shape
[
0
]);
ASSERT_EQ
(
global
->
shape
[
0
],
local
->
shape
[
0
]);
global
=
global
.
CopyTo
(
CPU
);
global
=
global
.
CopyTo
(
CPU
);
for
(
size
_t
i
=
0
;
i
<
global
->
shape
[
0
];
++
i
)
{
for
(
int64
_t
i
=
0
;
i
<
global
->
shape
[
0
];
++
i
)
{
EXPECT_EQ
(
Ptr
<
IdType
>
(
global
)[
i
]
%
num_parts
,
part_id
)
EXPECT_EQ
(
Ptr
<
IdType
>
(
global
)[
i
]
%
num_parts
,
part_id
)
<<
"i="
<<
i
<<
", num_parts="
<<
num_parts
<<
"i="
<<
i
<<
", num_parts="
<<
num_parts
<<
", part_id="
<<
part_id
;
<<
", part_id="
<<
part_id
;
...
@@ -70,7 +70,7 @@ void _TestRemainder_MapToX() {
...
@@ -70,7 +70,7 @@ void _TestRemainder_MapToX() {
// the remapped local indices to should match the original
// the remapped local indices to should match the original
local
=
local
.
CopyTo
(
CPU
);
local
=
local
.
CopyTo
(
CPU
);
ASSERT_EQ
(
local
->
shape
[
0
],
act_local
->
shape
[
0
]);
ASSERT_EQ
(
local
->
shape
[
0
],
act_local
->
shape
[
0
]);
for
(
size
_t
i
=
0
;
i
<
act_local
->
shape
[
0
];
++
i
)
{
for
(
int64
_t
i
=
0
;
i
<
act_local
->
shape
[
0
];
++
i
)
{
EXPECT_EQ
(
Ptr
<
IdType
>
(
local
)[
i
],
Ptr
<
IdType
>
(
act_local
)[
i
]);
EXPECT_EQ
(
Ptr
<
IdType
>
(
local
)[
i
],
Ptr
<
IdType
>
(
act_local
)[
i
]);
}
}
}
}
...
@@ -167,7 +167,7 @@ void _TestRange_MapToX() {
...
@@ -167,7 +167,7 @@ void _TestRange_MapToX() {
ASSERT_EQ
(
global
->
shape
[
0
],
local
->
shape
[
0
]);
ASSERT_EQ
(
global
->
shape
[
0
],
local
->
shape
[
0
]);
global
=
global
.
CopyTo
(
CPU
);
global
=
global
.
CopyTo
(
CPU
);
for
(
size
_t
i
=
0
;
i
<
global
->
shape
[
0
];
++
i
)
{
for
(
int64
_t
i
=
0
;
i
<
global
->
shape
[
0
];
++
i
)
{
EXPECT_EQ
(
EXPECT_EQ
(
_FindPart
(
Ptr
<
IdType
>
(
global
)[
i
],
Ptr
<
IdType
>
(
range
),
num_parts
),
_FindPart
(
Ptr
<
IdType
>
(
global
)[
i
],
Ptr
<
IdType
>
(
range
),
num_parts
),
part_id
)
part_id
)
...
@@ -178,7 +178,7 @@ void _TestRange_MapToX() {
...
@@ -178,7 +178,7 @@ void _TestRange_MapToX() {
// the remapped local indices to should match the original
// the remapped local indices to should match the original
local
=
local
.
CopyTo
(
CPU
);
local
=
local
.
CopyTo
(
CPU
);
ASSERT_EQ
(
local
->
shape
[
0
],
act_local
->
shape
[
0
]);
ASSERT_EQ
(
local
->
shape
[
0
],
act_local
->
shape
[
0
]);
for
(
size
_t
i
=
0
;
i
<
act_local
->
shape
[
0
];
++
i
)
{
for
(
int64
_t
i
=
0
;
i
<
act_local
->
shape
[
0
];
++
i
)
{
EXPECT_EQ
(
Ptr
<
IdType
>
(
local
)[
i
],
Ptr
<
IdType
>
(
act_local
)[
i
]);
EXPECT_EQ
(
Ptr
<
IdType
>
(
local
)[
i
],
Ptr
<
IdType
>
(
act_local
)[
i
]);
}
}
}
}
...
...
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