In the simplest case, a float4 is just 4 floats. So when you have a kernel that receives a float4 as one argument, you can just pass in a 4-element float array: clSetKernelArg(kernel, a++, Sizeof.cl_float4, Pointer.to(new float[] { 1,2,3,4}));
For arrays of (i.e. pointers to) float4, you can analogously create a cl_mem with the desired size, e.g. count * Sizeof.cl_float4.
Of course, handling a float[n*4] array on Java side is not as convenient as handling an array of cl_float4 in C. But that’s hard to avoid. I once created utlities that, to some extent, allow “emulating” float4 as “structs”, at jocl.org - Utilities . But you should not consider this as a stable, universally applicable solution. There may be options to make the handling of something-like-a-float4 in Java more convenient, but these will depend on the application case.