Changed to use threadfence_block in device memory code