Skip to content

Implement matrix_cl overloads for prim & rev functions #1854

Description

@rok-cesnovar

Description

For a list of functions that have OpenCL support for both prim and rev for all exposed signatures see http://mc-stan.org/math/opencl_support.html

Functions with partial or no support that we are targeting to support in the immediate future:

prim rev
chol2inv
generalized_inverse
hmm_marginal
inverse_spd
lmgamma
log_mix
log_sum_exp
mdivide_left_spd
mdivide_right_spd
quad_form_diag
quad_form
quad_form_sym
sd
trace_gen_quad_form
trace x
trace_quad_form
variance

Legend:
x done
* not all signatures are supported

We also have implementations of rep_vector/row_vector but those can not be used in Stan with OpenCL because the inputs are scalars. Maybe only if we give them a suffix and stanc3 generates a suffixed call to rep_vector/row_vector. It's the same for rep_matrix(real, int, int).

Other functions not in our immediate plans:

  • cumulative_sum
  • bessel_first_kind, bessel_second_kind
  • choose
  • csr_extract_u, csr_extract_v, csr_extract_w
  • csr_matrix_times_vector, csr_to_dense_matrix
  • determinant
  • eigenvalues_sym, eigenvectors_sym
  • falling_factorial, log_falling_factorial, rising_factorial
  • log_determinant, log_softmax
  • modified_bessel_first_kind, modified_bessel_second_kind, log_modified_bessel_first_kind
  • rank
  • singular_values
  • softmax
  • sort_asc, sort_desc, sort_indices_asc, sort_indices_desc
  • qr_Q, qr_R, qr_thin_Q, qr_thin_R

Activity

  1. changed the title [-]Implement matrix_cl overloads for remaining /prim functions[/-] [+]Implement `matrix_cl<T>`/`var_value<matrix_cl<T>>` overloads for all prim & rev functions[/+] on Dec 7, 2020
  2. rok-cesnovar commented on Dec 7, 2020

    @rok-cesnovar
    MemberAuthor

    Rewrote this issue to now be a TODO list for non-distributions functions (_lpdf/_lpmf,_lcdf, _lccdf, etc are excluded). For now, I went through /prim again, will update /rev tomorrow.

    I am also attaching a test file with which I double-checked all of them compile.
    prim_sigs.cpp.txt

  3. changed the title [-]Implement `matrix_cl<T>`/`var_value<matrix_cl<T>>` overloads for all prim & rev functions[/-] [+]Implement matrix_cl<T> && var_value<matrix_cl<T>> overloads for all prim & rev functions[/+] on Dec 14, 2020
  4. changed the title [-]Implement matrix_cl<T> && var_value<matrix_cl<T>> overloads for all prim & rev functions[/-] [+]Implement matrix_cl<T> & var_value<matrix_cl<T>> overloads for all prim & rev functions[/+] on Dec 14, 2020
  5. changed the title [-]Implement matrix_cl<T> & var_value<matrix_cl<T>> overloads for all prim & rev functions[/-] [+]Implement matrix_cl overloads for prim & rev functions[/+] on Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions