@@ -96,7 +96,7 @@ func InitDevicesWithConfig(config *Config) error {
96
96
var initErrors []error
97
97
98
98
// Helper function to initialize devices and handle errors
99
- initializeDevice := func (deviceType string , commonWord string , initFunc func (interface {} ) (Devices , error ), config interface {} ) {
99
+ initializeDevice := func (deviceType string , commonWord string , initFunc func (any ) (Devices , error ), config any ) {
100
100
klog .Infof ("Initializing %s device" , commonWord )
101
101
device , err := initFunc (config )
102
102
if err != nil {
@@ -113,52 +113,52 @@ func InitDevicesWithConfig(config *Config) error {
113
113
deviceInitializers := []struct {
114
114
deviceType string
115
115
commonWord string
116
- initFunc func (interface {} ) (Devices , error )
117
- config interface {}
116
+ initFunc func (any ) (Devices , error )
117
+ config any
118
118
}{
119
- {nvidia .NvidiaGPUDevice , nvidia .NvidiaGPUCommonWord , func (cfg interface {} ) (Devices , error ) {
119
+ {nvidia .NvidiaGPUDevice , nvidia .NvidiaGPUCommonWord , func (cfg any ) (Devices , error ) {
120
120
nvidiaConfig , ok := cfg .(nvidia.NvidiaConfig )
121
121
if ! ok {
122
122
return nil , fmt .Errorf ("invalid configuration for %s" , nvidia .NvidiaGPUCommonWord )
123
123
}
124
124
return nvidia .InitNvidiaDevice (nvidiaConfig ), nil
125
125
}, config .NvidiaConfig },
126
- {cambricon .CambriconMLUDevice , cambricon .CambriconMLUCommonWord , func (cfg interface {} ) (Devices , error ) {
126
+ {cambricon .CambriconMLUDevice , cambricon .CambriconMLUCommonWord , func (cfg any ) (Devices , error ) {
127
127
cambriconConfig , ok := cfg .(cambricon.CambriconConfig )
128
128
if ! ok {
129
129
return nil , fmt .Errorf ("invalid configuration for %s" , cambricon .CambriconMLUCommonWord )
130
130
}
131
131
return cambricon .InitMLUDevice (cambriconConfig ), nil
132
132
}, config .CambriconConfig },
133
- {hygon .HygonDCUDevice , hygon .HygonDCUCommonWord , func (cfg interface {} ) (Devices , error ) {
133
+ {hygon .HygonDCUDevice , hygon .HygonDCUCommonWord , func (cfg any ) (Devices , error ) {
134
134
hygonConfig , ok := cfg .(hygon.HygonConfig )
135
135
if ! ok {
136
136
return nil , fmt .Errorf ("invalid configuration for %s" , hygon .HygonDCUCommonWord )
137
137
}
138
138
return hygon .InitDCUDevice (hygonConfig ), nil
139
139
}, config .HygonConfig },
140
- {iluvatar .IluvatarGPUDevice , iluvatar .IluvatarGPUCommonWord , func (cfg interface {} ) (Devices , error ) {
140
+ {iluvatar .IluvatarGPUDevice , iluvatar .IluvatarGPUCommonWord , func (cfg any ) (Devices , error ) {
141
141
iluvatarConfig , ok := cfg .(iluvatar.IluvatarConfig )
142
142
if ! ok {
143
143
return nil , fmt .Errorf ("invalid configuration for %s" , iluvatar .IluvatarGPUCommonWord )
144
144
}
145
145
return iluvatar .InitIluvatarDevice (iluvatarConfig ), nil
146
146
}, config .IluvatarConfig },
147
- {mthreads .MthreadsGPUDevice , mthreads .MthreadsGPUCommonWord , func (cfg interface {} ) (Devices , error ) {
147
+ {mthreads .MthreadsGPUDevice , mthreads .MthreadsGPUCommonWord , func (cfg any ) (Devices , error ) {
148
148
mthreadsConfig , ok := cfg .(mthreads.MthreadsConfig )
149
149
if ! ok {
150
150
return nil , fmt .Errorf ("invalid configuration for %s" , mthreads .MthreadsGPUCommonWord )
151
151
}
152
152
return mthreads .InitMthreadsDevice (mthreadsConfig ), nil
153
153
}, config .MthreadsConfig },
154
- {metax .MetaxGPUDevice , metax .MetaxGPUCommonWord , func (cfg interface {} ) (Devices , error ) {
154
+ {metax .MetaxGPUDevice , metax .MetaxGPUCommonWord , func (cfg any ) (Devices , error ) {
155
155
metaxConfig , ok := cfg .(metax.MetaxConfig )
156
156
if ! ok {
157
157
return nil , fmt .Errorf ("invalid configuration for %s" , metax .MetaxGPUCommonWord )
158
158
}
159
159
return metax .InitMetaxDevice (metaxConfig ), nil
160
160
}, config .MetaxConfig },
161
- {metax .MetaxSGPUDevice , metax .MetaxSGPUCommonWord , func (cfg interface {} ) (Devices , error ) {
161
+ {metax .MetaxSGPUDevice , metax .MetaxSGPUCommonWord , func (cfg any ) (Devices , error ) {
162
162
metaxConfig , ok := cfg .(metax.MetaxConfig )
163
163
if ! ok {
164
164
return nil , fmt .Errorf ("invalid configuration for %s" , metax .MetaxGPUCommonWord )
0 commit comments