In OpenCL the "PTX (like bytecode in java) to target converter" is an interpreter (like we have for bytecode in java) or an ahead-of-time assembler?
Asked
Active
Viewed 199 times
1 Answers
1
Java is just-in-time compiled, not interpreted.
PTX is also compiled at loadtime.
Not sure about OpenCL, but CUDA can also store pre-compiled binaries for a given set of architectures in the executable (and JIT the rest). It is an option in the CUDA compiler.

Aleksandr Dubinsky
- 22,436
- 15
- 82
- 99
-
In Java the same bytecode if encountered is translated again by JVM. What about PTX, will it also be translated again and again? – gpuguy Dec 31 '12 at 01:54
-
The JVM caches the machine code until it its shut down, but won't modify the executable to store it. Same thing with PTX. – Aleksandr Dubinsky Jan 02 '13 at 08:46
-
So then why is PTX conversion not slow? – gpuguy Jan 02 '13 at 08:59
-
Define slow. Compiling bytecode is fairly quick but still takes noticeable time. – Aleksandr Dubinsky Jan 02 '13 at 09:42