Displaying 20 results from an estimated 100 matches similar to: "Is it possible to pass a function argument from R to compiled code in C?"
2016 May 12
5
Single-threaded aspect
R Developers,
Could someone help explain what it means that R is single threaded? I am
trying to understand what is actually going on inside R when users want to
parallelize code. For example, using mclapply or foreach (with some
backend) somehow allows users to benefit from multiple CPUs.
Similarly there is the RcppParallel package for RMatrix/RVector objects.
But none of these address the
2016 May 12
3
Single-threaded aspect
On 12 May 2016 at 13:11, Mark van der Loo wrote:
| Charles,
|
| 1. Perhaps this question is better directed at the R-help or
| R-pacakge-devel mailinglist.
|
| 2. It basically means that R itself can only evaluate one R expression at
| the time.
|
| The parallel package circumvents this by starting multiple R-sessions and
| dividing workload.
|
| Compiled code called by R (such as C++ code
2016 May 12
1
Single-threaded aspect
Charles,
1. Perhaps this question is better directed at the R-help or
R-pacakge-devel mailinglist.
2. It basically means that R itself can only evaluate one R expression at
the time.
The parallel package circumvents this by starting multiple R-sessions and
dividing workload.
Compiled code called by R (such as C++ code through RCpp or C-code through
base R's interface) can execute
2019 Jan 05
1
unsorted - suggestion for performance improvement and ALTREP support for POSIXct
I believe the performance of isUnsorted() in sort.c could be improved by
calling REAL() once (outside of the for loop), rather than calling it twice
inside the loop. As an aside, it is implemented in the faster way in
doSort() (sort.c line 401). The example below shows the performance
improvement for a vectors of double of moving REAL() outside the for loop.
# example as implemented in
2018 Aug 06
2
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
Hi all,
I'm not sure if I'm not supposed to do the following (the dyn.unload
part, I mean) or this could be a bug (in R or Rcpp):
```
Rcpp::sourceCpp(code='
#include <Rcpp.h>
class Object {};
//[[Rcpp::export]]
SEXP new_object() {
return Rcpp::XPtr<Object>(new Object());
}'
)
new_object()
dyn.unload(list.files(tempdir(), ".(so|dll)$",
2014 Mar 03
1
reference classes, LAZY_DUPLICATE_OK, and external pointers
We (the lme4 authors) are having a problem with doing a proper deep
copy of a reference class object in recent versions of R-devel with
the LAZY_DUPLICATE_OK flag in src/main/bind.c enabled.
Apologies in advance for any improper terminology.
TL;DR Is there an elegant way to force non-lazy/deep copying in our
case? Is anyone else using reference classes with a field that is an
external pointer?
2007 Jan 25
3
SV: How to detect SpeexBits corruption
You might not be doing anything wrong. Speex is stateful and can
get into a bad state sometimes. It's happened to me too, but not
recently. And I've seen such bugs reported on this list and fixed.
I suggest several approaches to solving the problem:
1) Try compiling Speex without compiler optimizations and see if the
problem still occurs. Most likely it will, but this is an
2020 May 06
3
defining r audio connections
Dear R Devel,
Since Linux moved away from using a file-system interface for audio, I think it is necessary to write special libraries to interface with audio hardware from various languages on Linux.
In R, it seems like the appropriate datatype for a `snd_pcm_t` handle pointing to an open ALSA source or sink would be a "connection". Connection types are already defined in R for
2012 May 05
2
looking for adice on bigmemory framework with C++ and java interoperability
I work with problems that have rather large data requirements -- typically
a bunch of multigig arrays. Given how generous R is with using memory, the
only way for me to work with R has been to use bigmatrices from bigmemory
package. One thing that is missing a bit is interoperability of bigmatrices
with C++ and possibly java. What i mean by that is API that would allow
read and write filebacked
2016 May 12
0
Single-threaded aspect
Thank you Simon for the detailed reply. That explains much more of what I
was looking for from the R side.
Dirk, I'm sorry if I seem hung up on anything here but I am trying to
understand the details. My reply about XPtr or XPtr on arma/Eigen was to
confirm my understanding was correct, which it appears it was. I was not
aware the RVector/RMatrix objects don't connect to R as I am just
2011 Feb 06
5
Help with integrating R and c/c++
Hi,
I have been using R for close to two years now and have grown quite
comfortable with the language. I am presently trying to implement an
optimization routine in R (Newton Rhapson). I have some R functions that
calculate the gradient and hessian (pre requisite matrices) fairly
efficiently. Now, I have to call this function iteratively until some
convergance criterion is reached. I think the
2016 May 12
0
Single-threaded aspect
Thanks for the replies. Regarding the answer by Dirk, I didn't feel like I
still understood the reasoning why mclapply or foreach cannot handle XPtr
objects. Instead of cluttering the SO question with comments I was getting
the impression that this was a limitation inherited with R objects (which
XPtr is supposed to be a proxy for an R object according to Dirk's
comment). If this is not
2013 Jun 19
3
Calling an array in a struct in C to R
Hi there,
Although I'm a quite experienced R user and know my ways in C, I stumbled
upon a problem I don't know how to solve. Therefore, I hope someone can
provide me with the information or pointers I need in order to understand
the way in which the communication between R and C occurs. I have the
following C code which basicallly reflects what I want:
typedef struct
{
float
2016 May 14
2
R external pointer and GPU memory leak problem
My question is based on a project I have partially done, but there is still something I'm not clear.
My goal is to create a R package contains GPU functions (some are from Nividia cuda library, some are my self-defined CUDA functions)
My design is quite different from current R's GPU package, I want to create a R object (external pointer) point to GPU address, and run my GPU function
2013 Jan 07
2
Samba 4 on AIX with XLC
Has anyone tried building Samba 4.0 on AIX with XLC?
I'm moving right along, but tripping up on some bugs in source3/utils/net_rpc.c, source3/utils/net_rpc_printer.c, and source3/utils/net_cache.c where there is an invalid use of the ":" operator. According to some other posts on the PostgreSQL forum, this shouldn't compile anywhere, even though GCC apparently allows it??
2007 Jan 25
1
Minor fixed point scaling problem
First, let me say that I think the speex code is incredible in the way it
supports floating and fixed point code from one set of code. The same is
true for supporting multiple processors, etc... I've used speex with the
PC, TI 64xx and 55xx. Please view the following comments not as an attack
on speex (which I think is incredible!) but as my contribution to an open
source project.
I know
2017 Jul 11
6
RFC: Harvard architectures and default address spaces
Hello all, I’m looking into solving an AVR-specific issue and would love to
hear peoples thoughts on how to best fix it.
Background
As you may or may not know, I maintain the in-tree AVR backend, which also
happens to be (to the best of my knowledge) the first in-tree backend for a
Harvard architecture.
In this architecture, code lives inside the ‘program memory’ space
(numbered 1), whereas data
2018 Aug 09
0
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
R's dyn.unload() will unconditionally unload the given shared object; it
does not check whether there is any object (external pointer or weak
reference) with a C finalizer pointing into the space of the shared
object being unloaded. So it is expected that R will segfault later when
such finalizer is run.
Currently there is no other way than to handle this on the side of the
shared
2010 May 17
0
Rcpp 0.8.0 on CRAN
===== Summary =====
Version 0.8.0 of the Rcpp package was released to CRAN today. This release
marks another milestone in the ongoing redesign of the package, and
underlying C++ library.
===== Overview =====
Rcpp is an R package and C++ library that facilitates integration of C++
code in R packages.
The package features a set of C++ classes (Rcpp::IntegerVector,
Rcpp::Function,
2010 May 17
0
Rcpp 0.8.0 on CRAN
===== Summary =====
Version 0.8.0 of the Rcpp package was released to CRAN today. This release
marks another milestone in the ongoing redesign of the package, and
underlying C++ library.
===== Overview =====
Rcpp is an R package and C++ library that facilitates integration of C++
code in R packages.
The package features a set of C++ classes (Rcpp::IntegerVector,
Rcpp::Function,