pub unsafe extern "C" fn cuMemCreate(
handle: *mut CUmemGenericAllocationHandle,
size: usize,
prop: *const CUmemAllocationProp,
flags: c_ulonglong,
) -> CUresult
Expand description
\brief Create a CUDA memory handle representing a memory allocation of a given size described by the given properties
This creates a memory allocation on the target device specified through the \p prop structure. The created allocation will not have any device or host mappings. The generic memory \p handle for the allocation can be mapped to the address space of calling process via ::cuMemMap. This handle cannot be transmitted directly to other processes (see ::cuMemExportToShareableHandle). On Windows, the caller must also pass an LPSECURITYATTRIBUTE in \p prop to be associated with this handle which limits or allows access to this handle for a recipient process (see ::CUmemAllocationProp::win32HandleMetaData for more). The \p size of this allocation must be a multiple of the the value given via ::cuMemGetAllocationGranularity with the ::CU_MEM_ALLOC_GRANULARITY_MINIMUM flag. To create a CPU allocation targeting a specific host NUMA node, applications must set ::CUmemAllocationProp::CUmemLocation::type to ::CU_MEM_LOCATION_TYPE_HOST_NUMA and ::CUmemAllocationProp::CUmemLocation::id must specify the NUMA ID of the CPU. On systems where NUMA is not available ::CUmemAllocationProp::CUmemLocation::id must be set to 0. Specifying ::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT or ::CU_MEM_LOCATION_TYPE_HOST as the ::CUmemLocation::type will result in ::CUDA_ERROR_INVALID_VALUE.
Applications can set ::CUmemAllocationProp::requestedHandleTypes to ::CU_MEM_HANDLE_TYPE_FABRIC in order to create allocations suitable for sharing within an IMEX domain. An IMEX domain is either an OS instance or a group of securely connected OS instances using the NVIDIA IMEX daemon. An IMEX channel is a global resource within the IMEX domain that represents a logical entity that aims to provide fine grained accessibility control for the participating processes. When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory. If the allocating process does not have access setup for an IMEX channel, attempting to create a ::CUmemGenericAllocationHandle with ::CU_MEM_HANDLE_TYPE_FABRIC will result in ::CUDA_ERROR_NOT_PERMITTED. The nvidia-modprobe CLI provides more information regarding setting up of IMEX channels.
If ::CUmemAllocationProp::allocFlags::usage contains ::CU_MEM_CREATE_USAGE_TILE_POOL flag then the memory allocation is intended only to be used as backing tile pool for sparse CUDA arrays and sparse CUDA mipmapped arrays. (see ::cuMemMapArrayAsync).
\param[out] handle - Value of handle returned. All operations on this allocation are to be performed using this handle. \param[in] size - Size of the allocation requested \param[in] prop - Properties of the allocation to create. \param[in] flags - flags for future use, must be zero now. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr
\sa ::cuMemRelease, ::cuMemExportToShareableHandle, ::cuMemImportFromShareableHandle