def nvmlDeviceGetFanSpeed(handle):
    r"""
    /**
     * Retrieves the intended operating speed of the device's fan.
     *
     * Note: The reported speed is the intended fan speed.  If the fan is physically blocked and unable to spin, the
     * output will not match the actual fan speed.
     *
     * For all discrete products with dedicated fans.
     *
     * The fan speed is expressed as a percent of the maximum, i.e. full speed is 100%.
     *
     * @param device                               The identifier of the target device
     * @param speed                                Reference in which to return the fan speed percentage
     *
     * @return
     *         - \ref NVML_SUCCESS                 if \a speed has been set
     *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
     *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid or \a speed is NULL
     *         - \ref NVML_ERROR_NOT_SUPPORTED     if the device does not have a fan
     *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
     *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
     */
    nvmlReturn_t DECLDIR nvmlDeviceGetFanSpeed
    """
    c_speed = c_uint()
    fn = _nvmlGetFunctionPointer("nvmlDeviceGetFanSpeed")
    ret = fn(handle, byref(c_speed))
    _nvmlCheckReturn(ret)
    return bytes_to_str(c_speed.value)