From 55c65547bdabae67530744173773cd04b4b1d9e3 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 21 Aug 2024 16:25:27 +0300 Subject: [PATCH] Test fixes --- tests/testthat/test-opencl.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-opencl.R b/tests/testthat/test-opencl.R index 55c59e2c8..c60d3a169 100644 --- a/tests/testthat/test-opencl.R +++ b/tests/testthat/test-opencl.R @@ -74,7 +74,7 @@ test_that("all methods run with valid opencl_ids", { fit <- mod$sample(data = testing_data("bernoulli"), opencl_ids = c(0, 0), chains = 1) ) expect_false(is.null(fit$metadata()$opencl_platform_name)) - expect_false(is.null(fit$metadata()$opencl_ids_name)) + expect_false(is.null(fit$metadata()$opencl_device_name)) stan_file_gq <- testing_stan_file("bernoulli_ppc") mod_gq <- cmdstan_model(stan_file = stan_file_gq, cpp_options = list(stan_opencl = TRUE)) @@ -82,25 +82,25 @@ test_that("all methods run with valid opencl_ids", { fit <- mod_gq$generate_quantities(fitted_params = fit, data = testing_data("bernoulli"), opencl_ids = c(0, 0)), ) expect_false(is.null(fit$metadata()$opencl_platform_name)) - expect_false(is.null(fit$metadata()$opencl_ids_name)) + expect_false(is.null(fit$metadata()$opencl_device_name)) expect_sample_output( fit <- mod$sample(data = testing_data("bernoulli"), opencl_ids = c(0, 0)) ) expect_false(is.null(fit$metadata()$opencl_platform_name)) - expect_false(is.null(fit$metadata()$opencl_ids_name)) + expect_false(is.null(fit$metadata()$opencl_device_name)) expect_optim_output( fit <- mod$optimize(data = testing_data("bernoulli"), opencl_ids = c(0, 0)) ) expect_false(is.null(fit$metadata()$opencl_platform_name)) - expect_false(is.null(fit$metadata()$opencl_ids_name)) + expect_false(is.null(fit$metadata()$opencl_device_name)) expect_vb_output( fit <- mod$variational(data = testing_data("bernoulli"), opencl_ids = c(0, 0)) ) expect_false(is.null(fit$metadata()$opencl_platform_name)) - expect_false(is.null(fit$metadata()$opencl_ids_name)) + expect_false(is.null(fit$metadata()$opencl_device_name)) }) test_that("error for runtime selection of OpenCL devices if version less than 2.26", { @@ -108,6 +108,7 @@ test_that("error for runtime selection of OpenCL devices if version less than 2. fake_cmdstan_version("2.25.0") stan_file <- testing_stan_file("bernoulli") + data_list <- testing_data("bernoulli") mod <- cmdstan_model(stan_file = stan_file, cpp_options = list(stan_opencl = TRUE), force_recompile = TRUE) expect_error(