Skip to content

Commit b9a8e1d

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

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

support/accelerator.go

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

0 commit comments

Comments
 (0)