cuda.bindings.nvml.device_get_cpu_affinity#

cuda.bindings.nvml.device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size)#

Retrieves an array of unsigned ints (sized to cpu_set_size) of bitmasks with the ideal CPU affinity for the device For example, if processors 0, 1, 32, and 33 are ideal for the device and cpu_set_size == 2, result[0] = 0x3, result[1] = 0x3 This is equivalent to calling nvmlDeviceGetCpuAffinityWithinScope with NVML_AFFINITY_SCOPE_NODE.

Parameters:
  • device (intptr_t) – The identifier of the target device.

  • cpu_set_size (unsigned int) – The size of the cpu_set array that is safe to access.

Returns:

Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines.

Return type:

unsigned long

See also

nvmlDeviceGetCpuAffinity