UoB-HPC / BabelStream

STREAM, for lots of devices written in many programming models
Other
313 stars 109 forks source link

Java implementation #108

Closed tom91136 closed 2 years ago

tom91136 commented 3 years ago

This PR adds a Java implementation. This addresses reviewer comments from #103. In addition to the basic plain and threaded versions on the JDK, this PR also include implementations for Aparapi and TornadoVM.

Unlike every other language, Java's generic doesn't really work for primitives so I have to manually specialise for double and float. The current iteration has a few cases (GenericAparapiStreamKernel.java and GenericTornadoVMStream) where inheritance is used to reduce duplication. Judging by the amount of lines this saved, inlining these classes might actually be more readable.