def nvmlDeviceGetSamples(device, sampling_type, timeStamp):
    r"""
    /**
     * Gets recent samples for the GPU.
     *
     * For Kepler &tm; or newer fully supported devices.
     *
     * Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by
     * the driver.
     *
     * Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t.
     *
     * To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL.
     * The returned samplesCount will provide the number of samples that can be queried. The user needs to
     * allocate the buffer with size as samplesCount * sizeof(nvmlSample_t).
     *
     * lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the
     * underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query
     * to get more recent samples.
     *
     * This method fetches the number of entries which can be accommodated in the provided samples array, and the
     * reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this
     * method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost.
     *
     * @param device                        The identifier for the target device
     * @param type                          Type of sampling event
     * @param lastSeenTimeStamp             Return only samples with timestamp greater than lastSeenTimeStamp.
     * @param sampleValType                 Output parameter to represent the type of sample value as described in nvmlSampleVal_t
     * @param sampleCount                   Reference to provide the number of elements which can be queried in samples array
     * @param samples                       Reference in which samples are returned

     * @return
     *         - \ref NVML_SUCCESS                 if samples are successfully retrieved
     *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
     *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a samplesCount is NULL or
     *                                             reference to \a sampleCount is 0 for non null \a samples
     *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
     *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
     *         - \ref NVML_ERROR_NOT_FOUND         if sample entries are not found
     *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
     */
    nvmlReturn_t DECLDIR nvmlDeviceGetSamples
    """
    c_sampling_type = _nvmlSamplingType_t(sampling_type)
    c_time_stamp = c_ulonglong(timeStamp)
    c_sample_count = c_uint(0)
    c_sample_value_type = _nvmlValueType_t()
    fn = _nvmlGetFunctionPointer("nvmlDeviceGetSamples")

    ## First Call gets the size
    ret = fn(device, c_sampling_type, c_time_stamp, byref(c_sample_value_type), byref(c_sample_count), None)

    # Stop if this fails
    if (ret != NVML_SUCCESS):
        raise NVMLError(ret)

    sampleArray = c_sample_count.value * c_nvmlSample_t
    c_samples = sampleArray()
    ret = fn(device, c_sampling_type, c_time_stamp,  byref(c_sample_value_type), byref(c_sample_count), c_samples)
    _nvmlCheckReturn(ret)
    return (c_sample_value_type.value, c_samples[0:c_sample_count.value])
r"""
    /**
     * Gets recent samples for the GPU.
     *
     * For Kepler &tm; or newer fully supported devices.
     *
     * Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by
     * the driver.
     *
     * Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t.
     *
     * To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL.
     * The returned samplesCount will provide the number of samples that can be queried. The user needs to
     * allocate the buffer with size as samplesCount * sizeof(nvmlSample_t).
     *
     * lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the
     * underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query
     * to get more recent samples.
     *
     * This method fetches the number of entries which can be accommodated in the provided samples array, and the
     * reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this
     * method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost.
     *
     * @param device                        The identifier for the target device
     * @param type                          Type of sampling event
     * @param lastSeenTimeStamp             Return only samples with timestamp greater than lastSeenTimeStamp.
     * @param sampleValType                 Output parameter to represent the type of sample value as described in nvmlSampleVal_t
     * @param sampleCount                   Reference to provide the number of elements which can be queried in samples array
     * @param samples                       Reference in which samples are returned

     * @return
     *         - \ref NVML_SUCCESS                 if samples are successfully retrieved
     *         - \ref NVML_ERROR_UNINITIALIZED     if the library has not been successfully initialized
     *         - \ref NVML_ERROR_INVALID_ARGUMENT  if \a device is invalid, \a samplesCount is NULL or
     *                                             reference to \a sampleCount is 0 for non null \a samples
     *         - \ref NVML_ERROR_NOT_SUPPORTED     if this query is not supported by the device
     *         - \ref NVML_ERROR_GPU_IS_LOST       if the target GPU has fallen off the bus or is otherwise inaccessible
     *         - \ref NVML_ERROR_NOT_FOUND         if sample entries are not found
     *         - \ref NVML_ERROR_UNKNOWN           on any unexpected error
     */
    nvmlReturn_t DECLDIR nvmlDeviceGetSamples