diff --git a/support/accelerator.go b/support/accelerator.go new file mode 100644 index 0000000..2fb14a4 --- /dev/null +++ b/support/accelerator.go @@ -0,0 +1,18 @@ +package support + +var ( + AMD = Accelerator{Type: "gpu", ResourceLabel: "amd.com/gpu"} + CPU = Accelerator{Type: "cpu"} + NVIDIA = Accelerator{Type: "gpu", ResourceLabel: "nvidia.com/gpu", PrometheusGpuUtilizationLabel: "DCGM_FI_DEV_GPU_UTIL"} +) + +type Accelerator struct { + Type string + ResourceLabel string + PrometheusGpuUtilizationLabel string +} + +// Method to check if the accelerator is a GPU +func (a Accelerator) isGpu() bool { + return a != CPU +}