     sq::SizeType size = d_A.rows * d_A.cols;
     InLinear2dPtr<real> in(d_A.d_data, d_A.stride, d_A.cols);
 
-    size_t temp_storage_bytes;
+    size_t temp_storage_bytes = 0;
     cub::DeviceReduce::Min(NULL, temp_storage_bytes,
                            in, d_min->d_data, size, stream_, CUB_DEBUG);
     void *d_temp_storage = devStream_->allocate(temp_storage_bytes, __func__);

    }
    else {
        auto outPtr = AddAssignOutPtr<real>(d_c->d_data, addAssignFactor, alpha);
        size_t temp_storage_bytes;
        cub::DeviceReduce::Sum(NULL, temp_storage_bytes,
                               inPtr, outPtr, d_x.size, stream_, CUB_DEBUG);
        void *d_temp_storage = devStream_->allocate(temp_storage_bytes, __func__);

    sq::SizeType size = d_A.rows * d_A.cols;
    InLinear2dPtr<real> in(d_A.d_data, d_A.stride, d_A.cols);

    size_t temp_storage_bytes = 0;
    cub::DeviceReduce::Sum(NULL, temp_storage_bytes,
                           in, d_dst->d_data, size, stream_, CUB_DEBUG);
    void *d_temp_storage = devStream_->allocate(temp_storage_bytes, __func__);
