Skip to content

Commit

Permalink
remove set mod
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangruipeng committed Jul 25, 2019
1 parent 3debd65 commit 70161c5
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,6 @@ nvmlReturn_t nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t
return nvmlDeviceGetAccountingModeFunc(device, mode);
}
nvmlReturn_t (*nvmlDeviceSetAccountingModeFunc)(nvmlDevice_t device, nvmlEnableState_t mode);
nvmlReturn_t nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) {
if (nvmlDeviceSetAccountingModeFunc == NULL) {
return NVML_ERROR_FUNCTION_NOT_FOUND;
}
return nvmlDeviceSetAccountingModeFunc(device, mode);
}
nvmlReturn_t (*nvmlDeviceGetAccountingStatsFunc)(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t *stats);
nvmlReturn_t nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t *stats) {
if (nvmlDeviceGetAccountingStatsFunc == NULL) {
Expand Down Expand Up @@ -288,10 +280,6 @@ nvmlReturn_t nvmlInit_dl(void) {
if (nvmlDeviceGetAccountingModeFunc == NULL) {
return NVML_ERROR_FUNCTION_NOT_FOUND;
}
nvmlDeviceSetAccountingModeFunc = dlsym(nvmlHandle, "nvmlDeviceSetAccountingMode");
if (nvmlDeviceSetAccountingModeFunc == NULL) {
return NVML_ERROR_FUNCTION_NOT_FOUND;
}
nvmlDeviceGetAccountingStatsFunc = dlsym(nvmlHandle, "nvmlDeviceGetAccountingStats");
if (nvmlDeviceGetAccountingStatsFunc == NULL) {
return NVML_ERROR_FUNCTION_NOT_FOUND;
Expand Down Expand Up @@ -632,20 +620,6 @@ func (d Device) DeviceGetAccountingMode() (C.nvmlEnableState_t, error) {
return stats, errorString(r)
}

// DeviceSetAccountingMode Queries the state of per process accounting mode.
// @param enable Whether enable nvml's accounting mode
func (d Device) DeviceSetAccountingMode(enable bool) error {
if C.nvmlHandle == nil {
return errLibraryNotLoaded
}
var mode C.nvmlEnableState_t = C.NVML_FEATURE_DISABLED
if enable {
mode = C.NVML_FEATURE_ENABLED
}
r := C.nvmlDeviceSetAccountingMode(d.dev, mode)
return errorString(r)
}

// DeviceGetAccountingStats Queries process's accounting stats.
// @param pid Process Id of the target process to query stats for
// @return stats Reference in which to return the process's accounting stats
Expand Down

0 comments on commit 70161c5

Please sign in to comment.