Skip to content

Commit e396ec9

Browse files
committed
Move accelerator function to codeflare-common support
1 parent eb81248 commit e396ec9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: support/accelerator.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package support
2+
3+
var (
4+
AMD = Accelerator{Type: "gpu", ResourceLabel: "amd.com/gpu"}
5+
CPU = Accelerator{Type: "cpu", ResourceLabel: "nvidia.com/gpu"}
6+
NVIDIA = Accelerator{Type: "gpu", ResourceLabel: "nvidia.com/gpu", PrometheusGpuUtilizationLabel: "DCGM_FI_DEV_GPU_UTIL"}
7+
)
8+
9+
type Accelerator struct {
10+
Type string
11+
ResourceLabel string
12+
PrometheusGpuUtilizationLabel string
13+
}
14+
15+
// Method to check if the accelerator is a GPU
16+
func (a Accelerator) isGpu() bool {
17+
return a != CPU
18+
}

0 commit comments

Comments
 (0)