Avoid reading lazy arrays or on device arrays twice when comparing them to 0 during the writing process.