Resonant, broadband, and highly efficient optical frequency conversion in semiconductor nanowire gratings at visible and UV wavelengths