File tree 2 files changed +4
-25
lines changed
2 files changed +4
-25
lines changed Original file line number Diff line number Diff line change 40
40
'version' ,
41
41
]
42
42
43
- CPP_OPTS = [
44
- 'STAN_OPENCL' ,
45
- 'OPENCL_DEVICE_ID' ,
46
- 'OPENCL_PLATFORM_ID' ,
47
- 'STAN_MPI' ,
48
- 'STAN_THREADS' ,
49
- ]
50
-
51
43
52
44
class CompilerOptions :
53
45
"""
@@ -151,18 +143,10 @@ def validate_cpp_opts(self) -> None:
151
143
"""
152
144
if self ._cpp_options is None :
153
145
return
154
- if (
155
- 'OPENCL_DEVICE_ID' in self ._cpp_options .keys ()
156
- or 'OPENCL_PLATFORM_ID' in self ._cpp_options .keys ()
157
- ):
158
- self ._cpp_options ['STAN_OPENCL' ] = 'TRUE'
159
-
160
- for key , val in self ._cpp_options .items ():
161
- if key not in CPP_OPTS :
162
- raise ValueError (
163
- 'unknown CmdStan makefile option: {}' .format (key )
164
- )
165
- if key in ['OPENCL_DEVICE_ID' , 'OPENCL_PLATFORM_ID' ]:
146
+ for key in ['OPENCL_DEVICE_ID' , 'OPENCL_PLATFORM_ID' ]:
147
+ if key in self ._cpp_options :
148
+ self ._cpp_options ['STAN_OPENCL' ] = 'TRUE'
149
+ val = self ._cpp_options [key ]
166
150
if not isinstance (val , int ) or val < 0 :
167
151
raise ValueError (
168
152
'{} must be a non-negative integer value,'
Original file line number Diff line number Diff line change @@ -121,11 +121,6 @@ def test_opts_cpp(self):
121
121
opts .validate ()
122
122
self .assertEqual (opts .compose (), ['STAN_MPI=TRUE' ])
123
123
124
- cpp_opts ['STAN_BAD' ] = 'TRUE'
125
- opts = CompilerOptions (cpp_options = cpp_opts )
126
- with self .assertRaises (ValueError ):
127
- opts .validate ()
128
-
129
124
def test_opts_cpp_opencl (self ):
130
125
cpp_opts = {'OPENCL_DEVICE_ID' : 1 }
131
126
opts = CompilerOptions (cpp_options = cpp_opts )
You can’t perform that action at this time.
0 commit comments