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.
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.hif one wants to extend Rcpp by customas()andwrap()functions. That does not work for RViennaCL since the ViennaCL headers have been patched to already includeRcpp.he.g.RViennaCL/inst/include/viennacl/ocl/backend.hpp
Line 29 in 93527ef
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::coutby default but would be overwritten toRcpp::Rcoutin RViennaCL. This way this patch could be communicated upstream.