4 ms·
Just because you can doesn't mean you should. Even OpenCL for FPGAs was too much of an impedence mismatch to be useful for the vast majority of cases. And get
by monocasa 7y ago
Just because you can doesn't mean you should. Even OpenCL for FPGAs was too much of an impedence mismatch to be useful for the vast majority of cases.
And getting Java to even run on these is going to remove so many features that there's no real reason to pick it anyway. It's sorta like how JavaCard that removes keywords like "new", "long" and "throw". Like at that point it's a stretch to even call it Java.
- DannyB2 7y agoEven with those restrictions, it might be useful. Just as J2ME was useful. Write the performance critical parts in this restricted subset to leverage the hardware capability. Write the rest of the application in ordinary JVM languages.
- monocasa 7y agoJ2ME is a full Java with GC etc. It's just missing some standard library features. This is restricted enough to essentially be a whole other language.
- bilbo0s 7y agoI don't know man, running the examples, it was obvious this is a whole lot more useful than some random "whole other language". At the moment, I'm integrating some avatar dressing code I'd written. That'll be a pretty good test of its utility. But so far, pretty impressed.
- DannyB2 7y agoJ2ME was missing floating point. Remember the flip phones and candy bar phones of the 2000s prior to the iPhone? I remember having to use an int to have 16 bits to left and 16 bits to right of "binary point". Then have simplistic trig functions on these. And functions to convert between an ordinary int and this "fixed point within an int" type.
- monocasa 7y agoI'm pretty sure you could use float, it was just heavily discouraged for games since the VM typically executed the float bytecodes in software.
- DannyB2 7y agoI specifically remember that float was not available. It was a big effort to overcome that to have basic trig functions good enough to make an "asteroids" type game. I read about it not being available. The textbooks said so. I checked. It was a compile error to use float. Here are a couple of links. Remember this was a very long time ago. Like 20 years. https://books.google.com/books?id=O4m0TrliwscC&pg=PA297&lpg=PA297&dq=j2md+lacked+float&source=bl&ots=T72po8GzBx&sig=ACfU3U0HFwXSRpk-y_-OdQg417qpccTXGw&hl=en&sa=X&ved=2ahUKEwjVyfPR5ZLoAhUaknIEHR0tAwAQ6AEwAHoECAoQAQ#v=onepage&q=j2md%20lacked%20float&f=false https://books.google.com/books?id=O4m0TrliwscC&pg=PA297&lpg=... https://www.javaworld.com/article/2076023/go-wireless-with-j2me-and-more.html https://www.javaworld.com/article/2076023/go-wireless-with-j...
- deleted 7y ago[deleted]
- ajuc 7y agoDon't think of it as alternative to java, think of it as an alternative to writing the critical path of bigger java code in opencl/assembler/fortran. With this you can write the critical method in subset of java, test it using standard java tooling and then run it on gpu. All your tools will work because it's a subset of java - so you can use the same code formatter, static analysis tools, build scripts, continuous integration, IDE highlighting and completion. You can use IDE refactoring over the whole codebase instead of doing it in 2 phases on 2 different languages (or more often doing the performance-sensitive parts by hand). That's a big difference, much better than maintaining codebase in 2 languages one of which usually isn't supported by your tools.
- pjmlp 7y agoBeing stuck with C, while CUDA allows for higher level programming models, is one of the reasons why most researchers just flocked to CUDA. When Khronos realised they should have had their own PTX (SPIR) and higher level programming models, the race was already lost.
- monocasa 7y agoCUDA kernels were C syntax for well until after CUDA had dominance over GPGPU.
- pjmlp 7y agoCUDA kernels have supported C, C++, Fortran and PTX since 10 years now, with Java, .NET, Haskell initiatives from Intel, Oracle, NVidia, IBM for quite some time as well.
- monocasa 7y agoI'm pretty sure they didn't add C++ kernel support at least until CUDA 5, and it had beaten OpenCL at that point.
- llukas 7y agoYou're incorrect. C++ support was limited but GPU-useful things like templates were from early versions. You can check for yourself here (ie. check for texture fetch functions signatures) https://arcb.csc.ncsu.edu/~mueller/cluster/nvidia/2.0/Programming_Guide_2.0beta2.pdf https://arcb.csc.ncsu.edu/~mueller/cluster/nvidia/2.0/Progra...
- monocasa 7y agoI mean, they didn't support classes for a long time. That's not C++.
- 7y ago