From cbe786ac02b2968797eed7db5537e948f539fb24 Mon Sep 17 00:00:00 2001 From: viclafargue Date: Tue, 10 Dec 2024 11:12:32 +0100 Subject: [PATCH] device_matrix_view_from_host patch for Grace --- cpp/src/neighbors/detail/cagra/utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/neighbors/detail/cagra/utils.hpp b/cpp/src/neighbors/detail/cagra/utils.hpp index 0f8309328..20dfa29d7 100644 --- a/cpp/src/neighbors/detail/cagra/utils.hpp +++ b/cpp/src/neighbors/detail/cagra/utils.hpp @@ -184,7 +184,7 @@ class device_matrix_view_from_host { cudaPointerAttributes attr; RAFT_CUDA_TRY(cudaPointerGetAttributes(&attr, host_view.data_handle())); device_ptr = reinterpret_cast(attr.devicePointer); - if (device_ptr == NULL) { + if (attr.type != cudaMemoryTypeDevice && attr.type != cudaMemoryTypeManaged) { // allocate memory and copy over // NB: We use the temporary "large" workspace resource here; this structure is supposed to // live on stack and not returned to a user.