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
7b470eb0
Unverified
Commit
7b470eb0
authored
Apr 08, 2024
by
Muhammed Fatih BALIN
Committed by
GitHub
Apr 08, 2024
Browse files
[GraphBolt] Quick fix for GCC 8 (#7279)
parent
e847fc44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
graphbolt/src/cuda/extension/unique_and_compact_map.cu
graphbolt/src/cuda/extension/unique_and_compact_map.cu
+6
-5
No files found.
graphbolt/src/cuda/extension/unique_and_compact_map.cu
View file @
7b470eb0
...
...
@@ -166,15 +166,16 @@ UniqueAndCompactBatchedHashMapBased(
pointers_and_offsets
.
data_ptr
<
int64_t
>
()
+
3
*
num_batches
;
for
(
std
::
size_t
i
=
0
;
i
<
num_batches
;
i
++
)
{
pointers_ptr
[
2
*
i
]
=
unique_dst_ids
.
at
(
i
).
data_ptr
<
index_t
>
();
offsets_ptr
[
2
*
i
]
=
unique_dst_ids
[
i
].
size
(
0
);
offsets_ptr
[
2
*
i
+
1
]
=
unique_dst_ids
[
i
].
size
(
0
);
pointers_ptr
[
2
*
i
+
1
]
=
src_ids
.
at
(
i
).
data_ptr
<
index_t
>
();
offsets_ptr
[
2
*
i
+
1
]
=
src_ids
[
i
].
size
(
0
);
offsets_ptr
[
2
*
i
+
2
]
=
src_ids
[
i
].
size
(
0
);
pointers_ptr
[
2
*
num_batches
+
i
]
=
dst_ids
.
at
(
i
).
data_ptr
<
index_t
>
();
offsets_ptr
[
2
*
num_batches
+
i
]
=
dst_ids
[
i
].
size
(
0
);
offsets_ptr
[
2
*
num_batches
+
i
+
1
]
=
dst_ids
[
i
].
size
(
0
);
}
// Finish computing the offsets by taking a cumulative sum.
std
::
exclusive_scan
(
offsets_ptr
,
offsets_ptr
+
3
*
num_batches
+
1
,
offsets_ptr
,
0ll
);
offsets_ptr
[
0
]
=
0
;
std
::
partial_sum
(
offsets_ptr
,
offsets_ptr
+
3
*
num_batches
+
1
,
offsets_ptr
);
// Device version of the tensors defined above. We store the information
// initially on the CPU, which are later copied to the device.
auto
pointers_and_offsets_dev
=
torch
::
empty
(
...
...
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