Skip to content

question on interaction of compiler options #519

Answered by rok-cesnovar
grburgess asked this question in Q&A
Discussion options

You must be logged in to vote

What STAN_OPENCL does if the model is not compiled with use-opencl in stanc.

Nothing really as none of the OpenCL-related stuff will be used, so this just adds a bit more code in C++ so a bit longer compile times. You need the use-opencl flag in stanc3 in order to generate the model with the OpenCL-related constructs (matrix_cl class, etc) and setting STAN_OPENCL then enables the OpenCL code in Stan Math so that the generated C++ actually compiles.

To sum up:

  • no use-opencl stanc3 flag & STAN_OPENCL=False -> normal sequential case
  • no use-opencl stanc3 flag & STAN_OPENCL=True -> same as sequential code, a bit longer compile times excepted
  • use-opencl stanc3 flag & STAN_OPENCL= False -> if…

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by WardBrian
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #517 on January 21, 2022 18:34.