javaopencljocl

Java OpenCL: Passing scalar parameter to kernel in JOCL


Does there exist a way to pass scalar parameter to kernel in JOCL without creating a new array? In C++ one can simply cast the scalar parameter (for example, int) to void*


Solution

  • Yes, there are methods like putArg(float), putArg(int), which are passing scalar args to the kernel.

    Take a look at their examples.