19 #include <raft/util/cudart_utils.hpp>
21 #include <cuda_runtime.h>
27 cudaPointerAttributes att;
28 cudaPointerGetAttributes(&att, ptr);
34 cudaPointerAttributes att;
35 cudaError_t err = cudaPointerGetAttributes(&att, p);
36 ASSERT(err == cudaSuccess || err == cudaErrorInvalidValue,
"%s", cudaGetErrorString(err));
38 if (err == cudaErrorInvalidValue) {
40 err = cudaGetLastError();
41 ASSERT(err == cudaErrorInvalidValue,
"%s", cudaGetErrorString(err));
49 return p_memory_type == cudaMemoryTypeDevice || p_memory_type == cudaMemoryTypeManaged;
Definition: dbscan.hpp:30
bool is_device_or_managed_type(const void *p)
Definition: ml_cuda_utils.h:46
cudaMemoryType memory_type(const void *p)
Definition: ml_cuda_utils.h:32
int get_device(const void *ptr)
Definition: ml_cuda_utils.h:25