mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-23 00:38:26 +00:00
978d439cf8
This change adds the internal bindings for Sandboxutils, some of which have been automatically generated with the help of c-for-go. The format followed is similar to what is used in go-nvml. These would need to be regenerated when the header file is modified and new APIs are added. Signed-off-by: Evan Lezar <elezar@nvidia.com> Signed-off-by: Huy Nguyen <huyn@nvidia.com> Signed-off-by: Sananya Majumder <sananyam@nvidia.com>
73 lines
2.6 KiB
Go
73 lines
2.6 KiB
Go
/**
|
|
# Copyright 2024 NVIDIA CORPORATION
|
|
#
|
|
# 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.
|
|
**/
|
|
|
|
// WARNING: THIS FILE WAS AUTOMATICALLY GENERATED.
|
|
// Code generated by https://git.io/c-for-go. DO NOT EDIT.
|
|
|
|
package nvsandboxutils
|
|
|
|
/*
|
|
#cgo linux LDFLAGS: -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files
|
|
#cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
|
|
#include "nvsandboxutils.h"
|
|
#include <stdlib.h>
|
|
#include "cgo_helpers.h"
|
|
*/
|
|
import "C"
|
|
import "unsafe"
|
|
|
|
// nvSandboxUtilsInit function as declared in nvsandboxutils/nvsandboxutils.h
|
|
func nvSandboxUtilsInit(Input *InitInput) Ret {
|
|
cInput, _ := (*C.nvSandboxUtilsInitInput_t)(unsafe.Pointer(Input)), cgoAllocsUnknown
|
|
__ret := C.nvSandboxUtilsInit(cInput)
|
|
__v := (Ret)(__ret)
|
|
return __v
|
|
}
|
|
|
|
// nvSandboxUtilsShutdown function as declared in nvsandboxutils/nvsandboxutils.h
|
|
func nvSandboxUtilsShutdown() Ret {
|
|
__ret := C.nvSandboxUtilsShutdown()
|
|
__v := (Ret)(__ret)
|
|
return __v
|
|
}
|
|
|
|
// nvSandboxUtilsGetDriverVersion function as declared in nvsandboxutils/nvsandboxutils.h
|
|
func nvSandboxUtilsGetDriverVersion(Version *byte, Length uint32) Ret {
|
|
cVersion, _ := (*C.char)(unsafe.Pointer(Version)), cgoAllocsUnknown
|
|
cLength, _ := (C.uint)(Length), cgoAllocsUnknown
|
|
__ret := C.nvSandboxUtilsGetDriverVersion(cVersion, cLength)
|
|
__v := (Ret)(__ret)
|
|
return __v
|
|
}
|
|
|
|
// nvSandboxUtilsGetGpuResource function as declared in nvsandboxutils/nvsandboxutils.h
|
|
func nvSandboxUtilsGetGpuResource(Request *GpuRes) Ret {
|
|
cRequest, _ := (*C.nvSandboxUtilsGpuRes_t)(unsafe.Pointer(Request)), cgoAllocsUnknown
|
|
__ret := C.nvSandboxUtilsGetGpuResource(cRequest)
|
|
__v := (Ret)(__ret)
|
|
return __v
|
|
}
|
|
|
|
// nvSandboxUtilsGetFileContent function as declared in nvsandboxutils/nvsandboxutils.h
|
|
func nvSandboxUtilsGetFileContent(FilePath *byte, Content *byte, ContentSize *uint32) Ret {
|
|
cFilePath, _ := (*C.char)(unsafe.Pointer(FilePath)), cgoAllocsUnknown
|
|
cContent, _ := (*C.char)(unsafe.Pointer(Content)), cgoAllocsUnknown
|
|
cContentSize, _ := (*C.uint)(unsafe.Pointer(ContentSize)), cgoAllocsUnknown
|
|
__ret := C.nvSandboxUtilsGetFileContent(cFilePath, cContent, cContentSize)
|
|
__v := (Ret)(__ret)
|
|
return __v
|
|
}
|