[PATCH] GPU Exploitation Infrastructure (original) (raw)

Ben Walsh ben_walsh at uk.ibm.com
Thu Feb 1 14:01:23 UTC 2018


As per the responses to http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-January/051181.html , I am reposting this patch to this mailing list ...

This patch provides the infrastructure to enable the exploitation of a GPU by the compiler to accelerate certain suitable Java constructs.

When enabled, a suitable compiler can attempt to accelerate the following Java constructs by launching the corresponding lambda expression on the GPU:

IntStream.range().parallel().forEach() IntStream.rangeClosed().parallel().forEach()

where:

  <range> defines upper and lower bounds
  <lambda> is a correctly defined lambda expression

As it stands, with the HotSpot compiler, this patch performs a "no op" in the newly added in-built native library method. This can be extended so that the HotSpot compiler attempts the acceleration detailed above instead.

I would like to pair with a sponsor to contribute this patch ...


diff -r fd237da7a113 make/hotspot/symbols/symbols-unix --- a/make/hotspot/symbols/symbols-unix Mon Jan 22 23:06:29 2018 -0800 +++ b/make/hotspot/symbols/symbols-unix Tue Jan 30 10:07:18 2018 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

This code is free software; you can redistribute it and/or modify it

@@ -187,3 +187,6 @@ JVM_AddReadsModule JVM_DefineModule JVM_SetBootLoaderUnnamedModule + +# GPU exploitation support +Java_java_util_stream_IntPipeline_promoteGPUCompile diff -r fd237da7a113 src/hotspot/share/include/jvm.h --- a/src/hotspot/share/include/jvm.h Mon Jan 22 23:06:29 2018 -0800 +++ b/src/hotspot/share/include/jvm.h Tue Jan 30 10:07:18 2018 +0000 @@ -1,5 +1,5 @@ /*

+/*

all diff -r fd237da7a113 src/java.base/share/classes/java/util/stream/IntPipeline.java --- a/src/java.base/share/classes/java/util/stream/IntPipeline.java Mon Jan 22 23:06:29 2018 -0800 +++ b/src/java.base/share/classes/java/util/stream/IntPipeline.java Tue Jan 30 10:07:18 2018 +0000 @@ -1,5 +1,5 @@ /*

instanceof Streams.RangeIntSpliterator;

(Streams.RangeIntSpliterator)getSourceSpliterator();

== 1){

specific method option

intRange.last == 1){

diff -r fd237da7a113 src/java.base/share/classes/java/util/stream/Streams.java --- a/src/java.base/share/classes/java/util/stream/Streams.java Mon Jan 22 23:06:29 2018 -0800 +++ b/src/java.base/share/classes/java/util/stream/Streams.java Tue Jan 30 10:07:18 2018 +0000 @@ -1,5 +1,5 @@ /*

bound // is Integer.MAX_VALUE // All elements are traversed if from == upTo & last == 0

traversed // Otherwise, 0 if the range is open, or is a closed range and all // elements have been traversed


Regards, Ben Walsh

Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



More information about the valhalla-dev mailing list