From 2fe76ab7048c5d6c6b5d380b6f41a2320fb4de0c Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Tue, 16 Feb 2021 13:05:02 +0000 Subject: [PATCH] Update generated bindings Signed-off-by: Kevin Klues --- pkg/nvml/cgo_helpers.h | 2 +- pkg/nvml/const.go | 2 +- pkg/nvml/const_gen.go | 19 +++++++++++++++++++ pkg/nvml/doc.go | 2 +- pkg/nvml/nvml.go | 2 +- pkg/nvml/system.go | 7 ++----- 6 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 pkg/nvml/const_gen.go diff --git a/pkg/nvml/cgo_helpers.h b/pkg/nvml/cgo_helpers.h index e23bf58..ba94c1e 100644 --- a/pkg/nvml/cgo_helpers.h +++ b/pkg/nvml/cgo_helpers.h @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// WARNING: This file has automatically been generated on Wed, 03 Feb 2021 13:08:24 UTC. +// WARNING: This file has automatically been generated on Tue, 16 Feb 2021 14:53:33 UTC. // Code generated by https://git.io/c-for-go. DO NOT EDIT. #include "nvml.h" diff --git a/pkg/nvml/const.go b/pkg/nvml/const.go index 6c2a97d..1f5e6d3 100644 --- a/pkg/nvml/const.go +++ b/pkg/nvml/const.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// WARNING: This file has automatically been generated on Wed, 03 Feb 2021 13:08:24 UTC. +// WARNING: This file has automatically been generated on Tue, 16 Feb 2021 14:53:33 UTC. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package nvml diff --git a/pkg/nvml/const_gen.go b/pkg/nvml/const_gen.go new file mode 100644 index 0000000..36a66f6 --- /dev/null +++ b/pkg/nvml/const_gen.go @@ -0,0 +1,19 @@ +// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nvml + +const ( + SYSTEM_PROCESS_NAME_BUFFER_SIZE = 256 +) diff --git a/pkg/nvml/doc.go b/pkg/nvml/doc.go index b3690b5..a1c8537 100644 --- a/pkg/nvml/doc.go +++ b/pkg/nvml/doc.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// WARNING: This file has automatically been generated on Wed, 03 Feb 2021 13:08:24 UTC. +// WARNING: This file has automatically been generated on Tue, 16 Feb 2021 14:53:33 UTC. // Code generated by https://git.io/c-for-go. DO NOT EDIT. /* diff --git a/pkg/nvml/nvml.go b/pkg/nvml/nvml.go index c557d08..b0eadbe 100644 --- a/pkg/nvml/nvml.go +++ b/pkg/nvml/nvml.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// WARNING: This file has automatically been generated on Wed, 03 Feb 2021 13:08:24 UTC. +// WARNING: This file has automatically been generated on Tue, 16 Feb 2021 14:53:33 UTC. // Code generated by https://git.io/c-for-go. DO NOT EDIT. package nvml diff --git a/pkg/nvml/system.go b/pkg/nvml/system.go index 55f6aaa..424f99b 100644 --- a/pkg/nvml/system.go +++ b/pkg/nvml/system.go @@ -14,9 +14,6 @@ package nvml -// #include -import "C" - // nvml.SystemGetDriverVersion() func SystemGetDriverVersion() (string, Return) { Version := make([]byte, SYSTEM_DRIVER_VERSION_BUFFER_SIZE) @@ -47,8 +44,8 @@ func SystemGetCudaDriverVersion_v2() (int, Return) { // nvml.SystemGetProcessName() func SystemGetProcessName(Pid int) (string, Return) { - Name := make([]byte, C.PR_SET_NAME) - ret := nvmlSystemGetProcessName(uint32(Pid), &Name[0], C.PR_SET_NAME) + Name := make([]byte, SYSTEM_PROCESS_NAME_BUFFER_SIZE) + ret := nvmlSystemGetProcessName(uint32(Pid), &Name[0], SYSTEM_PROCESS_NAME_BUFFER_SIZE) return string(Name[:clen(Name)]), ret }