Compiling to heterogeneous core ISA
Bharadwaj Yadavalli
bharadwaj.yadavalli at oracle.com
Thu Nov 15 11:28:25 PST 2012
On a heterogeneous system, one can imagine various ways for the (Java or
any other language JIT)
compiler can decide the architecture (GPU or CPU) to target. Techniques
such as language
extensions (or some form of hints provided by the application
developer); automatic decision making
by the compiler (such as automatic parallelization) - along with some
combination of the two - come
to mind. However, I am interested in exploring the possibility of
generating code for GPUs for code
written using the currently defined Java language constructs and using
the existing JVM specification.
I believe that this exploration will expose missing pieces, if any -
either in the language or the JVM - that
are needed to achieve the goal of generating code to target the
heterogeneous cores, while inflicting as
small amount of pain as possible on the language users, yet maximizing
the utilization of the compute resources.
As we all know, Lambda expressions for Java are taking shape and are
planned to be supported in the
very near future, I am wondering if we could use lambda function
definition as the hint for the compiler
to generate code for the lambda function to run on the GPU (providing
any necessary conditions are met).
At the same time, the compiler will also need to generate code to map
data to execute the lambda function
on GPU to the appropriate memory space.
This model will conceptually allow for visualizing and implementing a
hotspot compiler (C1 or C2) backend
targeting GPUs - one of the areas I plan to work in.
By starting with compiling lambda functions to GPUs, I believe we can
get a better understanding of
the ways to make online decisions of work scheduling between various
heterogeneous cores and using
the lessons to potentially extend compilation to standard (non-lambda)
class methods targeting GPUs.
I realize there are several people working on projects such as Aparapi
on the mailing-list and am hoping that
I can get comments and suggestions from them and others that have had
experience in writing code using such
frameworks.
Thanks,
Bharadwaj
More information about the sumatra-dev
mailing list