How to pass a 2D array to a function
Unsized arrays aren't implemented in HLSL. You can pass fixed-size arrays into functions like
void foo(float2 x[2][4])
{
    ...
}

(Note the brackets go after the parameter name, not after the type—just like declaring a variable.)
However, having different array sizes that can be passed into the same function won't work in HLSL the way it would in C/C++. For variable-size data, better to use a buffer resource, such as a constant buffer, structured buffer, etc (depending on what you're doing with this data). Or if it's in groupshared memory, you'll have to specify a maximum size and allocate the array for that.