Computations of three-dimensional cavity flow at subsonic and supersonic Mach numbers