FastR: Inlining failing
Juan Fumero
juan.fumero at ed.ac.uk
Fri Jul 1 09:39:00 UTC 2016
Hi all,
Within FastR, I am working now Tuples (RList with fixed types) in R
for the GPU. I get a runtime error when I am trying to compile the
function through the Partial Evaluator.
<code>
# Simple test case
Tuple2 <- function(x, y) {
t <- list(name="tuple2", a=x, b=y)
attr(t, "class") <- "tuple2"
return(t)
}
gpuFunction <- function(x) {
return(Tuple2(x, x))
}
# R sapply for GPUs
result <- marawacc.sapply(1:1000, gpuFunction)
</code>
When Graal tries to compile the gpuFunction through the
OptimzedCallTarget, I get the following error in FastR. Any idea? I do
not get why this is a recursive inlining,
[truffle] opt
fail gpuFunction
|Reason jdk.vm.ci.code.BailoutException: Too deep inlining, probably
caused by recursive inlining. Inlined methods ordered by inlining
frequency:
java.util.ResourceBundle.getObject(String) [488]
java.text.DecimalFormatSymbols.getInstance(Locale) [1]
java.util.Formatter.<init>(Locale, Appendable) [1]
com.oracle.graal.truffle.OptimizedCallTarget.callRoot(Object[]) [1]
java.lang.String.format(String, Object[]) [1]
com.oracle.graal.truffle.OptimizedCallTarget.callProxy(VirtualFrame)
[1]
java.text.DecimalFormatSymbols.<init>(Locale) [1]
java.util.Formatter.getZero(Locale) [1]
com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.gpuExecution
(VirtualFrame) [1]
java.text.DecimalFormatSymbols.initialize(Locale) [1]
com.oracle.truffle.r.runtime.RInternalError.<init>(Throwable, String,
Object[]) [1]
java.util.Formatter.<init>() [1]
com.oracle.truffle.r.nodes.function.FunctionDefinitionNode.execute(Virt
ualFrame) [1]
sun.util.locale.provider.LocaleResources.getDecimalFormatSymbolsData()
[1]
sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(L
ocale) [1]
It does work if, instead of returning as S3 object, I return an RList.
<code>
gpuFunction <- function(x) {
list(name="tuple2",x,x)
}
</code>
As a work around I am working with RList directly, but I would like to return an S3 object. Any idea is welcome.
Cheers
Juan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://mail.openjdk.java.net/pipermail/graal-dev/attachments/20160701/26e84334/attachment.ksh>
More information about the graal-dev
mailing list