Skip to content

Commit 9a86a66

Browse files
authored
[GraphBolt][CUDA] Remove unused num_bits argument from UniqueAndCompact (#7764)
1 parent 6cd7fe9 commit 9a86a66

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

graphbolt/include/graphbolt/cuda_ops.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ torch::Tensor IndptrEdgeIdsImpl(
299299
*/
300300
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> UniqueAndCompact(
301301
const torch::Tensor src_ids, const torch::Tensor dst_ids,
302-
const torch::Tensor unique_dst_ids, int num_bits = 0);
302+
const torch::Tensor unique_dst_ids);
303303

304304
/**
305305
* @brief Batched version of UniqueAndCompact. The ith element of the return
@@ -310,7 +310,7 @@ std::vector<std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>>
310310
UniqueAndCompactBatched(
311311
const std::vector<torch::Tensor>& src_ids,
312312
const std::vector<torch::Tensor>& dst_ids,
313-
const std::vector<torch::Tensor>& unique_dst_ids, int num_bits = 0);
313+
const std::vector<torch::Tensor>& unique_dst_ids);
314314

315315
} // namespace ops
316316
} // namespace graphbolt

graphbolt/src/cuda/unique_and_compact_impl.cu

+5-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ std::vector<std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>>
6161
UniqueAndCompactBatchedSortBased(
6262
const std::vector<torch::Tensor>& src_ids,
6363
const std::vector<torch::Tensor>& dst_ids,
64-
const std::vector<torch::Tensor>& unique_dst_ids, int num_bits) {
64+
const std::vector<torch::Tensor>& unique_dst_ids, int num_bits = 0) {
6565
auto allocator = cuda::GetAllocator();
6666
auto stream = cuda::GetCurrentStream();
6767
auto scalar_type = src_ids.at(0).scalar_type();
@@ -276,7 +276,7 @@ std::vector<std::tuple<torch::Tensor, torch::Tensor, torch::Tensor>>
276276
UniqueAndCompactBatched(
277277
const std::vector<torch::Tensor>& src_ids,
278278
const std::vector<torch::Tensor>& dst_ids,
279-
const std::vector<torch::Tensor>& unique_dst_ids, int num_bits) {
279+
const std::vector<torch::Tensor>& unique_dst_ids) {
280280
if (cuda::compute_capability() >= 70) {
281281
// Utilizes a hash table based implementation, the mapped id of a vertex
282282
// will be monotonically increasing as the first occurrence index of it in
@@ -287,15 +287,13 @@ UniqueAndCompactBatched(
287287
// Utilizes a sort based algorithm, the mapped id of a vertex part of the
288288
// src_ids but not part of the unique_dst_ids will be monotonically increasing
289289
// as the actual vertex id increases. Thus, it is deterministic.
290-
return UniqueAndCompactBatchedSortBased(
291-
src_ids, dst_ids, unique_dst_ids, num_bits);
290+
return UniqueAndCompactBatchedSortBased(src_ids, dst_ids, unique_dst_ids);
292291
}
293292

294293
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> UniqueAndCompact(
295294
const torch::Tensor src_ids, const torch::Tensor dst_ids,
296-
const torch::Tensor unique_dst_ids, int num_bits) {
297-
return UniqueAndCompactBatched(
298-
{src_ids}, {dst_ids}, {unique_dst_ids}, num_bits)[0];
295+
const torch::Tensor unique_dst_ids) {
296+
return UniqueAndCompactBatched({src_ids}, {dst_ids}, {unique_dst_ids})[0];
299297
}
300298

301299
} // namespace ops

0 commit comments

Comments
 (0)