Skip to content

Commit

Permalink
use memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed May 20, 2024
1 parent b6be7a1 commit 5060968
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions graphbolt/src/fused_csc_sampling_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1348,9 +1348,7 @@ static torch::Tensor NonUniformPickOp(
auto j = RandomEngine::ThreadLocal()->RandInt(i, num_neighbors);

Check warning on line 1348 in graphbolt/src/fused_csc_sampling_graph.cc

View workflow job for this annotation

GitHub Actions / lintrunner

CLANGFORMAT format

See https://clang.llvm.org/docs/ClangFormat.html. Run `lintrunner -a` to apply this patch.
std::swap(positive_probs_indices_ptr[i], positive_probs_indices_ptr[j]);
}
for (int64_t i = 0; i < fanout; ++i) {
ret_ptr[i] = positive_probs_indices_ptr[i];
}
std::memcpy(ret_ptr, positive_probs_indices_ptr, fanout * sizeof(int64_t));
} else if (fanout < 64) {
auto begin = ret_ptr;
auto end = ret_ptr + fanout;
Expand Down

0 comments on commit 5060968

Please sign in to comment.