public void setArg(int index, Object arg) {
        if (arg instanceof Byte) {
            setArg(index, (byte) arg);
        } else if (arg instanceof Short) {
            setArg(index, (short) arg);
        } else if (arg instanceof Integer) {
            setArg(index, (int) arg);
        } else if (arg instanceof Long) {
            setArg(index, (long) arg);
        } else if (arg instanceof Float) {
            setArg(index, (float) arg);
        } else if (arg instanceof Double) {
            setArg(index, (double) arg);
        } else if (arg instanceof Vector2f) {
            setArg(index, (Vector2f) arg);
        } else if (arg instanceof Vector4f) {
            setArg(index, (Vector4f) arg);
        } else if (arg instanceof Quaternion) {
            setArg(index, (Quaternion) arg);
        } else if (arg instanceof Matrix3f) {
            setArg(index, (Matrix3f) arg);
        } else if (arg instanceof Matrix4f) {
            setArg(index, (Matrix4f) arg);
        } else if (arg instanceof LocalMemPerElement) {
            setArg(index, (LocalMemPerElement) arg);
        } else if (arg instanceof LocalMem) {
            setArg(index, (LocalMem) arg);
        } else if (arg instanceof Buffer) {
            setArg(index, (Buffer) arg);
        } else if (arg instanceof Image) {
            setArg(index, (Image) arg);
        } else {
            throw new IllegalArgumentException("unknown kernel argument type: " + arg);
        }
    }
Sets the kernel argument at the specified index.<br>
The argument must be a known type:
{@code LocalMemPerElement, LocalMem, Image, Buffer, byte, short, int,
long, float, double, Vector2f, Vector4f, Quaternion, Matrix3f, Matrix4f}.
<br>
Note: Matrix3f and Matrix4f will be mapped to a {@code float16} (row major).

@param index the index of the argument, from 0 to {@link #getArgCount()}-1
@param arg the argument
@throws IllegalArgumentException if the argument type is not one of the listed ones
jme3-core/src/main/java/com/jme3/opencl/Kernel.java