Skip to content

Commit

Permalink
Add testcase for Issue stan-dev#765
Browse files Browse the repository at this point in the history
Demonstrate inability to sample models with opencl from exe file.
  • Loading branch information
katrinabrock committed Aug 8, 2024
1 parent 895e1d0 commit 7697378
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/test-opencl.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,13 @@ test_that("error for runtime selection of OpenCL devices if version less than 2.
)
reset_cmdstan_version()
})

test_that("model from exe_file retains open_cl option", {
skip_if_not(Sys.getenv("CMDSTANR_OPENCL_TESTS") %in% c("1", "true"))
stan_file <- testing_stan_file("bernoulli")
mod <- cmdstan_model(stan_file = stan_file, cpp_options = list(stan_opencl = TRUE))
mod_from_exe <- cmdstan_model(exe_file = mod$exe_file())
expect_sample_output(
fit <- mod_from_exe$sample(data = testing_data("bernoulli"), opencl_ids = c(0, 0), chains = 1)
)
})

0 comments on commit 7697378

Please sign in to comment.