A thermal rectifier/diode is a nonreciprocal element or system that enables preferential heat transport in one direction. In this work we demonstrate a single-material thermal diode operating at high temperatures. The diode is made of nanostructured silicon membranes exhibiting spatially and temperature-dependent thermal conductivity and, therefore, falling into the category of spatially asymmetric, nonlinear nonreciprocal systems. We used an all-optical state-of-the-art experimental technique to prove rectification along rigorous criteria of the phenomenon. Using sub-milliwatt power we achieve rectification of about 14%. In addition, we demonstrate air-triggered thermal switching and passive cooling. Our findings provide a CMOS-compatible platform for heat rectification and applications in energy harvesting, thermal insulation and cooling, as well as sensing and potentially thermal logic.