mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-24 21:14:00 +00:00
fix: apply options when constructing an instance of the nvcdi library
Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This commit is contained in:
parent
b6bab4d3fd
commit
a52c9f0ac6
@ -37,6 +37,9 @@ type nvcdilib struct {
|
|||||||
// New creates a new nvcdi library
|
// New creates a new nvcdi library
|
||||||
func New(opts ...Option) Interface {
|
func New(opts ...Option) Interface {
|
||||||
l := &nvcdilib{}
|
l := &nvcdilib{}
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(l)
|
||||||
|
}
|
||||||
|
|
||||||
if l.nvmllib == nil {
|
if l.nvmllib == nil {
|
||||||
l.nvmllib = nvml.New()
|
l.nvmllib = nvml.New()
|
||||||
|
Loading…
Reference in New Issue
Block a user