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

Allow implementation of as() and wrap() functions #4

Open
rstub opened this issue Mar 27, 2018 · 1 comment
Open

Allow implementation of as() and wrap() functions #4

rstub opened this issue Mar 27, 2018 · 1 comment

Comments

@rstub
Copy link

rstub commented Mar 27, 2018

This issue is motivated by https://stackoverflow.com/questions/49457018/using-rviennacl-for-matrix-multiplication/.

According to https://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-extending.pdf one needs to add some forward declarations before loading Rcpp.h if one wants to extend Rcpp by custom as() and wrap() functions. That does not work for RViennaCL since the ViennaCL headers have been patched to already include Rcpp.h e.g.

. I think it would be sufficient to change all these includes to RcppCommon.h, but I have not tested it.

Alternatively, one could use a macro for defining the output stream, similar to what (Rcpp)Armadillo does. This macro could use std::cout by default but would be overwritten to Rcpp::Rcout in RViennaCL. This way this patch could be communicated upstream.

@cdeterman
Copy link
Owner

@rstub thanks for the suggestions. This certainly gives me some ideas with a way to extend RViennaCL further. Once I get some time I will create a new branch and explore this.

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

2 participants