Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyg_lib/csrc/classes/cuda/hash_map.cu
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct CUDAHashMapImpl : HashMapImpl {

CUDAHashMapImpl(const at::Tensor& key, double load_factor)
: device_(key.device()) {
at::cuda::SetDevice(key.get_device());
cudaSetDevice(key.get_device());

KeyType constexpr empty_key_sentinel = std::numeric_limits<KeyType>::min();
ValueType constexpr empty_value_sentinel = -1;
Expand All @@ -59,7 +59,7 @@ struct CUDAHashMapImpl : HashMapImpl {
}

at::Tensor get(const at::Tensor& query) override {
at::cuda::SetDevice(query.get_device());
cudaSetDevice(query.get_device());

const auto options =
query.options().dtype(c10::CppTypeToScalarType<ValueType>::value);
Expand All @@ -73,7 +73,7 @@ struct CUDAHashMapImpl : HashMapImpl {
}

at::Tensor keys() override {
at::cuda::SetDevice(device_.index());
cudaSetDevice(device_.index());

const auto options = at::TensorOptions().device(device_);
const at::Tensor key = at::empty({size()}, options.dtype(dtype()));
Expand Down
Loading