Skip to content

Use & expose the CUDA-13.0 versions of cuMemAdvise(), cuMemPrefetchAsync() #749

@eyalroz

Description

@eyalroz

cuMemAdvise() changed with CUDA 13.0, into:

CUresult cuMemAdvise (
    CUdeviceptr devPtr, 
    size_t count, 
    CUmem_advise advice, 
    CUmemLocation location ) 

The difference is in the last parameter: It used to be a CUdevice device, now it's a CUmemLocation. This can be any of:

    CU_MEM_LOCATION_TYPE_INVALID    = 0x0,
    CU_MEM_LOCATION_TYPE_DEVICE     = 0x1,  /**< Location is a device location, thus id is a device ordinal */
    CU_MEM_LOCATION_TYPE_HOST       = 0x2,   /**< Location is host, id is ignored */
    CU_MEM_LOCATION_TYPE_HOST_NUMA  = 0x3,  /**< Location is a host NUMA node, thus id is a host NUMA node id */
    CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT = 0x4,  /**< Location is a host NUMA node of the current thread, id is ignored */
    CU_MEM_LOCATION_TYPE_MAX        = 0x7FFFFFFF

with the first two being invalid/unusable. cuMemPrefetchAsync() also changed similarly.

Let's support the new, richer parameter type. Also, need to pay attention to CU_DEVICE_CPU as the device ID.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions