Compute the size of an array that was passed as a parameter to a function
You can't. You are passing a pointer to the array, and sizeof will give you the size of that pointer (2 on an 8-bit Arduino).

Instead the normal way is to pass the size of the array as a parameter to your function.

myFunction(myArray, sizeof(myArray) / sizeof(myArray[0]));