Skip to content

Commit 1feefd6

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

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: support/support.go

+13
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,21 @@ var (
3535
TestTimeoutLong = 5 * time.Minute
3636
TestTimeoutDouble = 20 * time.Minute
3737
TestTimeoutGpuProvisioning = 30 * time.Minute
38+
AMD = Accelerator{ResourceLabel: "amd.com/gpu"}
39+
CPU = Accelerator{ResourceLabel: "nvidia.com/gpu"}
40+
NVIDIA = Accelerator{ResourceLabel: "nvidia.com/gpu", PrometheusGpuUtilizationLabel: "DCGM_FI_DEV_GPU_UTIL"}
3841
)
3942

43+
type Accelerator struct {
44+
ResourceLabel string
45+
PrometheusGpuUtilizationLabel string
46+
}
47+
48+
// Method to check if the accelerator is a GPU
49+
func (a Accelerator) isGpu() bool {
50+
return a != CPU
51+
}
52+
4053
func init() {
4154
if value, ok := os.LookupEnv("CODEFLARE_TEST_TIMEOUT_SHORT"); ok {
4255
if duration, err := time.ParseDuration(value); err == nil {

0 commit comments

Comments
 (0)