There’s a bug in some of the samples that gives the following error:
Exception in thread “AWT-EventQueue-0” org.jocl.CLException: CL_INVALID_CONTEXT
It’s due to context being redeclared bringing the global context out of scope:
// Try to create the OpenCL context on a GPU device
cl_context context = clCreateContextFromType(
Just remove cl_context and it will work. Other methods need to be able to use the global context, which the above defines.