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
f7b4c93d
Commit
f7b4c93d
authored
Oct 14, 2024
by
sangwzh
Browse files
fix bug for uva when getting the device pointer
parent
50c27a8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
graphbolt/src/cuda/index_select_impl.hip
graphbolt/src/cuda/index_select_impl.hip
+9
-1
No files found.
graphbolt/src/cuda/index_select_impl.hip
View file @
f7b4c93d
...
@@ -112,7 +112,15 @@ torch::Tensor UVAIndexSelectImpl_(torch::Tensor input, torch::Tensor index) {
...
@@ -112,7 +112,15 @@ torch::Tensor UVAIndexSelectImpl_(torch::Tensor input, torch::Tensor index) {
{return_len, original_feature_size}, torch::TensorOptions()
{return_len, original_feature_size}, torch::TensorOptions()
.dtype(input.dtype())
.dtype(input.dtype())
.device(c10::DeviceType::CUDA));
.device(c10::DeviceType::CUDA));
DType* input_ptr = reinterpret_cast<DType*>(input.data_ptr());
DType* input_ptr = nullptr;
if(input.is_pinned())
{
CUDA_CALL(hipHostGetDevicePointer((void**)&input_ptr, input.data_ptr(), 0));
}
else{
input_ptr= reinterpret_cast<DType*>(input.data_ptr());
}
DType* ret_ptr = reinterpret_cast<DType*>(ret.data_ptr());
DType* ret_ptr = reinterpret_cast<DType*>(ret.data_ptr());
// Sort the index to improve the memory access pattern.
// Sort the index to improve the memory access pattern.
...
...
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