Add support for marking a ref test as flaky on cpu and/or gpu.