for parallelized declFuns, we have need for code like this:
nc <- nClass(
Cpublic = list(
go = nFunction(
fun = function(x = 'numericVector') {
logProb_y <- x
sum <- 0
parallel_for(i, 1:length(x), {
logProb_y[i] <- 2*x[i]
sum <- sum + logProb_y[i]
})
return(sum)
},
returnType = 'numericScalar'
)
)
)
Cnc <- nCompile(nc)
Currently that gives this error in our compilation processing.
Error in TensorReduction(<environment>, NULL) :
could not find function "TensorReduction"
So we'll want to investigate if this is possible with TBB. Perhaps only with TBB reduction functionality given the need to write to shared sum.
for parallelized declFuns, we have need for code like this:
Currently that gives this error in our compilation processing.
So we'll want to investigate if this is possible with TBB. Perhaps only with TBB reduction functionality given the need to write to shared
sum.