...
In order to widen the types of lambda expressions that could be offloaded to the GPU, we wanted to be able to handle lambdas that used object allocation. The following describes some experiments with allocation using the HSAIL Backend to graal.
Note: As is true of many modern compilers, graal can avoid the actual allocation when it can use , by using escape analysis to , it canto prove that the allocated objects do not escape. Here's an example junit test where graal can successfully use escape analysis.
But we also wanted to handle lambdas where allocated objects really did escape. Here is a simple example where we start with an array of longs and we want to produce an array of Strings, one for each long. You can build and run this using the instructions on Standalone Sumatra Stream API Offload Demo assuming you are using the latest graal trunk.
...