Llama-3.1-8B-DALv0.1
/
venv
/lib
/python3.12
/site-packages
/torch
/include
/ATen
/cuda
/CUDADevice.h
namespace at::cuda { | |
inline Device getDeviceFromPtr(void* ptr) { | |
cudaPointerAttributes attr{}; | |
AT_CUDA_CHECK(cudaPointerGetAttributes(&attr, ptr)); | |
TORCH_CHECK(attr.type != cudaMemoryTypeUnregistered, | |
"The specified pointer resides on host memory and is not registered with any CUDA device."); | |
return {c10::DeviceType::CUDA, static_cast<DeviceIndex>(attr.device)}; | |
} | |
} // namespace at::cuda | |