Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve gpu update/compare interface #319

Open
richfitz opened this issue Nov 5, 2021 · 0 comments
Open

Improve gpu update/compare interface #319

richfitz opened this issue Nov 5, 2021 · 0 comments

Comments

@richfitz
Copy link
Member

richfitz commented Nov 5, 2021

No reason why we can't put the excessively ugly arguments into a struct:

void update_gpu<variable>(size_t step,
                          const dust::cuda::interleaved<variable::real_type> state,
                          dust::cuda::interleaved<int> internal_int,
                          dust::cuda::interleaved<variable::real_type> internal_real,
                          const int * shared_int,
                          const variable::real_type * shared_real,
                          variable::rng_state_type& rng_state,
                          dust::cuda::interleaved<variable::real_type> state_next);

could become

void update_gpu<variable>(size_t step, dust::cuda::model_state<sirs>);

with

template <typename T>
struct model_state {
  using real_type = typename T::real_type;
  const dust::cuda::interleaved<real_type> state;
  dust::cuda::interleaved<int> internal_int;
  dust::cuda::interleaved<real_type> internal_real;
  const int * shared_int;
  const real_type * shared_real;
  variable::rng_state_type& rng_state;
  dust::cuda::interleaved<real_type> state_next);
}

Then update the body to access these

@richfitz richfitz added this to the CRAN release (v1.0.x) milestone Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant