Recapture const-ness on variables in a parallel section

淺唱寂寞╮ 提交于 2019-12-11 03:15:26

问题


I have the following code:

const W = (f.IsUnit() ? U : modq.Multiply(m_pre_2_3q, U));

const Integer t = modp.Multiply(modp.Exponentiate(V, 3), eh);
const X = (f.IsUnit() ? t : modp.Multiply(m_pre_2_9p, t));

When converted to OpenMP, the const-ness is lost:

Integer W, X;
#pragma omp parallel sections
{
    #pragma omp section
    {
        W = (f.IsUnit() ? U : modq.Multiply(m_pre_2_3q, U));
    }

    #pragma omp section
    {
        const Integer t = modp.Multiply(modp.Exponentiate(V, 3), eh);
        X = (f.IsUnit() ? t : modp.Multiply(m_pre_2_9p, t));
    }
}

How do I recapture the const-ness on W and X when they appear in parallel sections?

来源:https://stackoverflow.com/questions/30836009/recapture-const-ness-on-variables-in-a-parallel-section

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!