<div dir="ltr">Greetings,<div><br></div><div>I have been exploring GPU implementations for R.  Primarily I have been using OpenCL given it is so portable and everyone can use it without being tied to NVIDIA.  That said, NVIDIA hardware is difficult to beat and creating packages that leverage are arguably valuable (e.g. gputools, gmatrix).  In my efforts to explore how to best develop these types of packages I must use NVCC but I also would like to continue leveraging Rcpp.  Normally, any compilation with NVCC would results in the following warnings and error when including Rcpp.h.</div><div><br></div><div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/r_cast.h(121): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/r_cast.h(74): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/vector/vector_from_string.h(42): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/r_cast.h(54): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/r_cast.h(74): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/r_cast.h(121): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/Environment.h(97): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/vector/vector_from_string.h(42): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/vector/Vector.h(324): warning: statement is unreachable</div><div><br></div><div>/usr/local/lib/R/site-library/Rcpp/include/Rcpp/vector/proxy.h(99): error: the object has type qualifiers that are not compatible with the member function "Rcpp::internal::string_name_proxy<RTYPE>::get"</div><div>            object type is: const Rcpp::internal::string_name_proxy<RTYPE></div></div><div><br></div><div><br></div><div>I stumbled upon another github user's package that tries to address this by a small modification in Rcpp.  You can see it here (<a href="https://github.com/jtilly/RcppThrust">https://github.com/jtilly/RcppThrust</a>) were the user notes that removing the 'const' in line 98 of Rcpp/vector/proxy.h allows the compilation to succeed (although the warnings continue).</div><div><br></div><div>Does anyone have any thoughts regarding this modification?  Would changing that line cause any issues?  I'm not sure about the warnings at the moment but at least nvcc and Rcpp could be used in concert.</div><div><br></div><div>Regards,</div><div>Charles</div></div>