Stream API - how to build -

Christian Thalinger christian.thalinger at oracle.com
Wed Feb 5 11:55:52 PST 2014


Great that you guys are finally getting to explore that area!

On Feb 5, 2014, at 2:35 AM, Juan Jose Fumero <juan.fumero at ed.ac.uk> wrote:

> Hi Doug,
>   great, I have compiled graal with JDK 8 and sumatra patch and It works fine.
> 
> $ bash sumatra.sh
> --- Running com.oracle.graal.compiler.hsail.test.BasicSumatraTest ---
> [HSAIL] library is libokra_x86_64.so
> [HSAIL] using _OKRA_SIM_LIB_PATH_=/tmp/okraresource.dir_7223059661454328370/libokra_x86_64.so
> [GPU] registered initialization of Okra (total initialized: 1)
> [HSAIL] heap=0x00007f938c018270
> [HSAIL] base=0xf0000000, capacity=24117248
> External method:com.oracle.graal.compiler.hsail.test.BasicSumatraTest.lambda$main$0([I[I[II)V
> installCode0: ExternalCompilationResult
> [HSAIL] sig:([I[I[II)V  args length=3
> [HSAIL] static method
> [HSAIL] HSAILKernelArguments::do_array 0xf026f010, is a [I
> [HSAIL] HSAILKernelArguments::do_array 0xf026efa0, is a [I
> [HSAIL] HSAILKernelArguments::do_array 0xf026efd8, is a [I
> [HSAIL] HSAILKernelArguments::not pushing trailing int
> [9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
> 
> 
> What I would like to do is to run for example the test like BasicSumatraTest ( in com.oracle.graal.compiler.hsail.test package) with our OpenCL backend. Taking this expression
> 
> 13         IntStream.range(0, a.length).parallel().forEach(id -> {
> 14             c[id] = a[id] + b[id];
> 15         });
> 
> and generate an OpenCL kernel and run it. We would like to explore some parallel patterns (taking stream API) and how to combine them to apply more optimisations.
> 
> Many thanks
> Juanjo
> 
> 
> On 04/02/14 22:05, Doug Simon wrote:
>> There’s also the sumatra-on-graal patch described in http://mail.openjdk.java.net/pipermail/graal-dev/2014-January/001523.html
>> 
>> -Doug
>> 
>> On Feb 4, 2014, at 10:36 PM, Eric Caspole <eric.caspole at amd.com> wrote:
>> 
>>> Hi Juanjo,
>>> The JDK 8 code in the Sumatra hg repo is really old and actually we have not been using it yet.
>>> 
>>> If you could explain a little more about what you want to do we can see if our modified Stream API at:
>>> 
>>> http://cr.openjdk.java.net/~ecaspole/sumatrajdk.02/webrev/
>>> 
>>> will work for you. Note this webrev is probably bit rot since it is from last July. I will do my best to update it tomorrow so it works with the JDK 8 tip, which is:
>>> 
>>> http://hg.openjdk.java.net/jdk8/jdk8/
>>> 
>>> Then you check out and build Graal, and the patch connects Graal to the JDK Stream offload.
>>> We are happy to welcome more Sumatra developers.
>>> Regards,
>>> Eric
>>> 
>>> 
>>> On 02/04/2014 11:16 AM, Juan Jose Fumero wrote:
>>>> Hello,
>>>>   I am trying to build JDK 8 and Stream API. Following the instructions
>>>> in [1], first I download the jdk8 and apply the patch with the patch
>>>> command in Linux. The patch was built with webrev and when I try to
>>>> apply it, It fails so I decided to do manually.  But, when the jdk is
>>>> compiling, I get the following error:
>>>> 
>>>> ...
>>>> ## Starting jdk
>>>> Compiling 9420 files for BUILD_JDK
>>>> /home/juanjo/phd/jdk8Sumatra/jdk/src/share/classes/java/util/stream/Streams.java:309:
>>>> error: cannot find symbol
>>>>             implements StreamBuilder<T> {
>>>>                        ^
>>>>   symbol:   class StreamBuilder
>>>>   location: class Streams
>>>> /home/juanjo/phd/jdk8Sumatra/jdk/src/share/classes/java/util/stream/Streams.java:355:
>>>> error: cannot find symbol
>>>>         public StreamBuilder<T> add(T t) {
>>>>                ^
>>>>   symbol:   class StreamBuilder
>>>>   location: class StreamBuilderImpl<T>
>>>>   where T is a type-variable:
>>>> ...
>>>> 
>>>> 
>>>> I guess I am doing something wrong.  Also I tried to download the
>>>> sumatra code but If I am not wrong, the Stream API in java.util is not
>>>> there [2]. I have seen the Aparapi project as well but I do not see
>>>> where they use the stream interface.
>>>> 
>>>> 
>>>> I would like to work with the Stream API and Graal with the aim to
>>>> connect our backend (source to source) for OpenCL. Our interest is to
>>>> work the interface in java.util.stream of Java 8 and provide some
>>>> optimisations and transformations in our backend based on this interface.
>>>> 
>>>> ///
>>>> //
>>>> //[1] /
>>>> ///https://wiki.openjdk.java.net/display/Sumatra/AMD+Sumatra+prototype%3A+APU+meets+Stream+API//
>>>> 
>>>> //[2] /
>>>> ///https://wiki.openjdk.java.net/display/Sumatra/Sumatra+Repository+Info///
>>>> ////
>>>> 
>>>> Thanks so much
>>>> Juanjo
>>>> 
>>>> 
>>>> 
>>>> The University of Edinburgh is a charitable body, registered in
>>>> Scotland, with registration number SC005336.
>>>> 
>> 
> 
> -- 
> PhD Student
> University of Edinburgh
> 10 Crichton Street
> Room 1.19
> Edinburgh
> EH8 9AB
> 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.



More information about the sumatra-dev mailing list