Skip to content

Commit

Permalink
Merge branch 'upstream-support-12-nvlinks' into 'master'
Browse files Browse the repository at this point in the history
Update go bindings to include up to 12 NVLINKs instead of 6

See merge request nvidia/container-toolkit/gpu-monitoring-tools!40
  • Loading branch information
klueska committed Nov 9, 2020
2 parents 7d13f77 + 46fe390 commit d08ea3c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bindings/go/nvml/nvml.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ const (
FourNVLINKLinks
FiveNVLINKLinks
SixNVLINKLinks
SevenNVLINKLinks
EightNVLINKLinks
NineNVLINKLinks
TenNVLINKLinks
ElevenNVLINKLinks
TwelveNVLINKLinks
)

type P2PLink struct {
Expand Down Expand Up @@ -178,6 +184,18 @@ func (t P2PLinkType) String() string {
return "Five NVLinks"
case SixNVLINKLinks:
return "Six NVLinks"
case SevenNVLINKLinks:
return "Seven NVLinks"
case EightNVLINKLinks:
return "Eight NVLinks"
case NineNVLINKLinks:
return "Nine NVLinks"
case TenNVLINKLinks:
return "Ten NVLinks"
case ElevenNVLINKLinks:
return "Eleven NVLinks"
case TwelveNVLINKLinks:
return "Twelve NVLinks"
case P2PLinkUnknown:
}
return "N/A"
Expand Down Expand Up @@ -618,6 +636,18 @@ func GetNVLink(dev1, dev2 *Device) (link P2PLinkType, err error) {
nvlink = FiveNVLINKLinks
case FiveNVLINKLinks:
nvlink = SixNVLINKLinks
case SixNVLINKLinks:
nvlink = SevenNVLINKLinks
case SevenNVLINKLinks:
nvlink = EightNVLINKLinks
case EightNVLINKLinks:
nvlink = NineNVLINKLinks
case NineNVLINKLinks:
nvlink = TenNVLINKLinks
case TenNVLINKLinks:
nvlink = ElevenNVLINKLinks
case ElevenNVLINKLinks:
nvlink = TwelveNVLINKLinks
}
}
}
Expand Down

0 comments on commit d08ea3c

Please sign in to comment.