wiki:XmtProgrammingTips

  • For functions that are called in a serial context but will have parallel regions inside, add a noalias pragma for all pointer and reference arguments. This can allow the compiler to optimize better.
    void fund(int i, int* i_ptr, int& i_ref)
    {
      #pragma mta noalias *i_ptr
      #pragma mta noalias i_ref
      ...
    }