@@ -11,7 +11,7 @@ def __init__(self):
11
11
pass
12
12
13
13
@staticmethod
14
- def get ():
14
+ def get (verbose = 1 ):
15
15
"""Get the CPU module object"""
16
16
# SWIG generated files contain some deprecated calls to imp
17
17
with warnings .catch_warnings ():
@@ -20,10 +20,11 @@ def get():
20
20
import h2o4gpu .libs .ch2o4gpu_cpu as ch2o4gpu_cpu
21
21
return ch2o4gpu_cpu
22
22
except ImportError as e :
23
- print ("Exception:" )
24
- print (e )
25
- print ('\n Warning: h2o4gpu shared object (dynamic library)'
26
- ' for CPU failed to load.' )
23
+ if verbose > 0 :
24
+ print ("Exception:" )
25
+ print (e )
26
+ print ('\n Warning: h2o4gpu shared object (dynamic library)'
27
+ ' for CPU failed to load.' )
27
28
return None
28
29
29
30
@@ -35,7 +36,7 @@ def __init__(self):
35
36
pass
36
37
37
38
@staticmethod
38
- def get ():
39
+ def get (verbose = 1 ):
39
40
"""Get the GPU module object"""
40
41
# SWIG generated files contain some deprecated calls to imp
41
42
with warnings .catch_warnings ():
@@ -44,17 +45,18 @@ def get():
44
45
import h2o4gpu .libs .ch2o4gpu_gpu as ch2o4gpu_gpu
45
46
return ch2o4gpu_gpu
46
47
except ImportError as e :
47
- print ("Exception:" )
48
- print (e )
49
- print ('\n Warning: h2o4gpu shared object (dynamic library)'
50
- ' for GPU failed to load.' )
48
+ if verbose > 0 :
49
+ print ("Exception:" )
50
+ print (e )
51
+ print ('\n Warning: h2o4gpu shared object (dynamic library)'
52
+ ' for GPU failed to load.' )
51
53
return None
52
54
53
55
54
- def get_lib (n_gpus , devices , verbose = 0 ):
56
+ def get_lib (n_gpus , devices , verbose = 1 ):
55
57
"""Load either CPU or GPU H2O4GPU library."""
56
- cpu_lib = CPUlib ().get ()
57
- gpu_lib = GPUlib ().get ()
58
+ cpu_lib = CPUlib ().get (verbose = verbose )
59
+ gpu_lib = GPUlib ().get (verbose = verbose )
58
60
if (n_gpus == 0 ) or \
59
61
(gpu_lib is None and cpu_lib is not None ) or \
60
62
(devices == 0 ):
0 commit comments