Recapture const-ness on variables in a parallel section

344 Views Asked by At

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?

0

There are 0 best solutions below