mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-29 07:21:46 +00:00
Merge branch 'fix-nvcdi-constructor' into 'main'
fix: apply options when constructing an instance of the nvcdi library See merge request nvidia/container-toolkit/container-toolkit!294
This commit is contained in:
commit
b4ab95f00c
@ -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