Displaying 19 results from an estimated 19 matches for "xptr".
Did you mean:
ptr
2016 May 12
5
Single-threaded aspect
...and 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 general XPtr objects in Rcpp. Some readers
here may recognize my question on SO (
http://stackoverflow.com/questions/37167479/rcpp-parallelize-functions-that-return-xptr)
where I was curious about parallel calls to C++/Rcpp functions that return
XPtr objects. I am being a little more persistent here as this l...
2016 May 12
3
Single-threaded aspect
...39;s C API
| from multiple threads (in many cases). For example, it is not thread-safe
| to create R-variables from multiple threads running in C. (R's variable
| administration is such that the order of (un)making them from compiled code
| matters).
Well put.
| I am not very savvy on Rcpp or XPtr objects, but it appears that Dirk
| provided answers about that in your SO-question.
Charles seems to hang himself up completely about a small detail, failing to
see the forest for the trees.
There are (many) working examples of parallel (compiled) code with R. All of
them stress (and I simplify...
2016 May 12
1
Single-threaded aspect
...code cannot call R's C API
from multiple threads (in many cases). For example, it is not thread-safe
to create R-variables from multiple threads running in C. (R's variable
administration is such that the order of (un)making them from compiled code
matters).
I am not very savvy on Rcpp or XPtr objects, but it appears that Dirk
provided answers about that in your SO-question.
Best,
Mark
Op do 12 mei 2016 om 14:46 schreef Charles Determan <cdetermanjr at gmail.com>:
> R Developers,
>
> Could someone help explain what it means that R is single threaded? I am
>...
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 now
familiarizing myself with the package, that explains more of my confusion.
I will look at doing work within the compiled c...
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 the case, I could repost this on Rcpp-devel
unless i...
2011 Sep 20
2
Is it possible to pass a function argument from R to compiled code in C?
I have a function in R that takes another function as argument:
f <- function(g, ...) { #g is expected to be a function
}
I want to see if there is a way to implement "f" in C and calling it from R
using ".C" interface. I know that I can use function pointers for my C
implementation, but I imagine it's going to be nearly impossible to pass a
function from R to C. Are
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)$", recursive=TRUE, full.names=TRUE))
gc() # segfault in R_RunWeakRefFinalizer
message("This is not printed")
```
This is the backtrace I get with R 3.5.1:
#0 0x61ec4fd0 in ?? ()...
2014 Mar 03
1
reference classes, LAZY_DUPLICATE_OK, and external pointers
...SEXP Zt, SEXP beta0,
SEXP delb, SEXP delu, SEXP theta, SEXP u0) {
BEGIN_RCPP;
merPredD *ans = new merPredD(Xs, Lambdat, LamtUt, Lind, RZX,
Ut, Utr, V, VtV,
Vtr, Xwts, Zt, beta0, delb, delu,
theta, u0);
return wrap(XPtr<merPredD>(ans, true));
END_RCPP;
}
2007 Jan 25
1
Minor fixed point scaling problem
...structions.
*/
static int norm_shift(const spx_sig_t *x, spx_sig_t max_scale, int
len)
{
int n0; // 32 bit container for finding 4 parallel 8 bit
minimums.
int n1; // 32 bit container for finding 4 parallel 8 bit
minimums.
char c0;
int *xptr;
int i;
#warn Using the TI optimized norm_shift() function using
_norm and _minu4 intrinsics.
/*
TI Specific.
*/
xptr=(int *)&x[0];
n0=0x7F7F7F7F; // Initialize to 4 max unsigned 8 bit values.
#i...
2018 Aug 09
0
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
...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)$", recursive=TRUE, full.names=TRUE))
> gc() # segfault in R_RunWeakRefFinalizer
>
> message("This is not printed")
> ```
>
> This is the b...
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
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
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
2010 May 17
0
Rcpp 0.8.0 on CRAN
...pp::Pairlist
----------------------------------------------------------
S4SXP | Rcpp::S4
----------------------------------------------------------
PROMSXP | Rcpp::Promise
WEAKREFSXP | Rcpp::WeakReference
EXTPTRSXP | template <typename T> Rcpp::XPtr
----------------------------------------------------------
Some SEXP types do not have dedicated Rcpp classes : NILSXP, DOTSXP,
ANYSXP, BCODESXP and CHARSXP.
Still missing are a few convenience classes such as Rcpp::Date or
Rcpp::Datetime which would map useful and frequently used R data types,...
2010 May 17
0
Rcpp 0.8.0 on CRAN
...pp::Pairlist
----------------------------------------------------------
S4SXP | Rcpp::S4
----------------------------------------------------------
PROMSXP | Rcpp::Promise
WEAKREFSXP | Rcpp::WeakReference
EXTPTRSXP | template <typename T> Rcpp::XPtr
----------------------------------------------------------
Some SEXP types do not have dedicated Rcpp classes : NILSXP, DOTSXP,
ANYSXP, BCODESXP and CHARSXP.
Still missing are a few convenience classes such as Rcpp::Date or
Rcpp::Datetime which would map useful and frequently used R data types,...
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