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

Vectorize fma (fused-multiply-add) #567

Closed
aaronjg opened this issue Jun 24, 2017 · 4 comments
Closed

Vectorize fma (fused-multiply-add) #567

aaronjg opened this issue Jun 24, 2017 · 4 comments

Comments

@aaronjg
Copy link

aaronjg commented Jun 24, 2017

Summary:

Please provide a short couple sentence summary.
Most of the composed functions have been vectorized, however fused-multiply add and some of the others that take two arguments only take reals.

Current Version:

v2.16.0

@bob-carpenter
Copy link
Contributor

Thanks for putting this in as an issue. I thought we had a general issue to vectorize all the scalar binary functions. But I don't see it, so I'll leave this one here.

If someone wants to take them on one at a time before that, that would also work. pow has been the most requested such function.

@aaronjg
Copy link
Author

aaronjg commented Jun 25, 2017

Just saw a post on discourse about this as well. Is it part of this issue? #202

@bob-carpenter
Copy link
Contributor

Yes, #202 listed all the scalar functions at one point that might be vectorized. fma has three arguments, so there'll be eight instantiations for each vectorized version in terms of autodiff types.

@rok-cesnovar
Copy link
Member

fma has since been vectorized. These are the supported signatures:

  fma(real, real, real) => real
  fma(real, real, vector) => vector
  fma(real, vector, real) => vector
  fma(real, vector, vector) => vector
  fma(vector, real, real) => vector
  fma(vector, real, vector) => vector
  fma(vector, vector, real) => vector
  fma(vector, vector, vector) => vector
  fma(real, real, row_vector) => row_vector
  fma(real, row_vector, real) => row_vector
  fma(real, row_vector, row_vector) => row_vector
  fma(row_vector, real, real) => row_vector
  fma(row_vector, real, row_vector) => row_vector
  fma(row_vector, row_vector, real) => row_vector
  fma(row_vector, row_vector, row_vector) => row_vector
  fma(real, real, matrix) => matrix
  fma(real, matrix, real) => matrix
  fma(real, matrix, matrix) => matrix
  fma(matrix, real, real) => matrix
  fma(matrix, real, matrix) => matrix
  fma(matrix, matrix, real) => matrix
  fma(matrix, matrix, matrix) => matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants