MCPcopy Create free account
hub / github.com/NVIDIA/DALI / GetDLDevice

Function GetDLDevice

dali/python/backend_impl.cc:549–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548template <typename Backend>
549DLDevice GetDLDevice(const Tensor<Backend> &tensor) {
550 if constexpr (std::is_same_v<Backend, GPUBackend>)
551 return { kDLCUDA, tensor.device_id() };
552 else
553 return { tensor.is_pinned() ? kDLCUDAHost : kDLCPU };
554}
555
556template <typename Backend>
557DLMTensorPtr ToDLMTensor(Tensor<Backend> &tensor,

Callers 2

ToDLMTensorFunction · 0.85
ExposeTensorFunction · 0.85

Calls 1

device_idMethod · 0.45

Tested by

no test coverage detected