SyTen

◆ get_memory()

void * syten::Cuda::CudaAllocator::get_memory ( std::size_t  sz,
std::int16_t  device 
)
inlineprivate

Helper function, obtains a block of memory of size sz from CUDA on device device.

If CUDA is disabled, uses standard l_malloc().

Parameters
[in]szsize of the requested allocation in bytes
[in]devicedevice on which the allocation should take place
Returns
a device pointer to the allocation, valid for device device or nullptr if the allocation failed.

References cuda_handle_error, syten::l_malloc(), syten::Cuda::select_device(), and syten::Cuda::synchronise().

Referenced by alloc(), and get_from_upper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: