File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 11package catboost_test
22
33import (
4+ "errors"
45 "fmt"
6+ "runtime"
57 "testing"
68
79 cb "github.com/mirecl/catboost-cgo/catboost"
@@ -164,3 +166,29 @@ func TestGetError(t *testing.T) {
164166 err = cb .GetError ()
165167 require .NoError (t , err )
166168}
169+
170+ func TestGetSupportedEvaluatorTypes (t * testing.T ) {
171+ // init test model
172+ model , err := cb .LoadFullModelFromFile (testModelPathRegressor )
173+ require .NoError (t , err )
174+
175+ devices , err := model .GetSupportedEvaluatorTypes ()
176+ require .NoError (t , err )
177+ require .True (t , len (devices ) > 0 )
178+ }
179+
180+ func TestEnableGPUEvaluation (t * testing.T ) {
181+ // init test model
182+ model , err := cb .LoadFullModelFromFile (testModelPathRegressor )
183+ require .NoError (t , err )
184+
185+ err = model .EnableGPUEvaluation ()
186+
187+ if runtime .GOOS == "darwin" {
188+ require .True (t , errors .Is (err , cb .ErrNotSupportedGPU ))
189+ }
190+
191+ if runtime .GOOS == "linux" {
192+ require .NoError (t , err )
193+ }
194+ }
You can’t perform that action at this time.
0 commit comments