Vektorisierungs- und ParallelisierungsmeldungenVectorizer and parallelizer messages

Sie können die Microsoft C++-Compileroptionen /Qpar-report und verwenden /Qvec-report , um die Automatische Parallelisierung und automatische Vektorisierung so festzulegen, dass Grund Codes und Informationsmeldungen über Ihre Aktivität ausgegeben werden.You can use the Microsoft C++ compiler options /Qpar-report and /Qvec-report to set the Auto-parallelization and auto-vectorization to output reason codes and informational messages about its activity. Dieser Artikel beschreibt die Ursachencodes und Nachrichten.This article explains the reason codes and the messages.

InformationsmeldungenInformational messages

Abhängig von der Berichterstellungsebene, die Sie angeben, wird eine der folgenden Informationsmeldungen für jede Schleife ausgegeben.Depending on the reporting level that you specify, one of the following informational messages appears for each loop.

Informationen zu Ursachencodes finden Sie im nächsten Teil dieses Artikels.For information about reason codes, refer to the next part of this article.

InformationsmeldungInformational message BESCHREIBUNGDescription
50015001 Schleife vektorisiertLoop vectorized.
50025002 Die Schleife ist aufgrund der Ursache "Description" nicht vektorisiert.Loop not vectorized because of reason 'description'.
50115011 Schleife parallelisiertLoop parallelized.
50125012 Die Schleife wird aufgrund der Ursache "Description" nicht parallelisiert.Loop not parallelized because of reason 'description'.
50215021 Schleife kann dem Pragma nicht zugeordnet werden.Unable to associate loop with pragma.

In den folgenden Abschnitten werden mögliche Ursachen Codes für den Parallelisierung und Vectorizer aufgelistet.The following sections list possible reason codes for the parallelizer and vectorizer.

5xx-Ursachen Codes5xx reason codes

Die 5-xx -Ursachen Codes gelten für den Parallelisierung und den Vectorizer.The 5 xx reason codes apply to both the parallelizer and the vectorizer.

UrsachencodeReason code ErklärungExplanation
500500 Eine generische Nachricht, die mehrere Fälle abdeckt, z. b., wenn die-Schleife mehrere-Aktionen enthält, oder wenn der Schleifen Header nicht durch Erhöhen der-einfügervariablen endet.A generic message that covers several cases: For example, the loop includes multiple exits, or the loop header doesn't end by incrementing the induction variable.
501501 Die Induktions Variable ist nicht lokal. oder die obere Grenze ist nicht Schleifen invariant.Induction variable isn't local; or upper bound isn't loop-invariant.
502502 Die Induktionsvariable wird anders erhöht als durch einfaches +1.Induction variable is stepped in some manner other than a simple +1.
503503 Die Schleife enthält Ausnahmebehandlungs- oder Switch-Anweisungen.Loop includes exception-handling or switch statements.
504504 In der Schleife wird möglicherweise eine Ausnahme ausgelöst, welche die Zerstörung eines C++-Objekts erfordert.Loop body may throw an exception that requires destruction of a C++ object.
505505 Äußere Schleife verfügt über eine vorab inkrementierte Einführungs Variable.Outer loop has a pre-incremented induction variable. Die Analyse wird beendet.Exiting analysis.
void code_500(int *A)
{
    // Code 500 is emitted if the loop has non-vectorizable flow.
    // This can include "if", "break", "continue", the conditional
    // operator "?", or function calls.
    // It also encompasses correct definition and use of the induction
    // variable "i", in that the increment "++i" or "i++" must be the last
    // statement in the loop.

    int i = 0;
    while (i<1000)
    {
        if (i == 4)
        {
            break;
        }

        ++i;

        A[i] = A[i] + 1;
    }
    // To resolve code 500, use a 'for' loop with single increment of
    // induction variable.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

int bound();
void code_501_example1(int *A)
{
    // Code 501 is emitted if the compiler cannot discern the
    // induction variable of this loop. In this case, when it checks
    // the upper bound of 'i', the compiler cannot prove that the
    // function call "bound()" returns the same value each time.
    // Also, the compiler cannot prove that the call to "bound()"
    // does not modify the values of array A.

    for (int i=0; i<bound(); ++i)
    {
        A[i] = A[i] + 1;
    }

    // To resolve code 501, ensure that the induction variable is
    // a local variable, and ensure that the upper bound is a
    // provably loop invariant value.

    for (int i=0, imax = bound(); i<imax; ++i)
    {
        A[i] = A[i] + 1;
    }
}

int i;
void code_501_example2(int *A)
{
    // Code 501 is emitted if the compiler cannot discern the
    // induction variable of this loop. In this case, 'i' is
    // a global.

    for (i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }

    // To resolve code 501, ensure that the induction variable is
    // a local variable, and ensure that the upper bound is a
    // provably loop invariant value.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

void code_502(int *A)
{
    // Code 502 is emitted if the compiler cannot discern
    // the induction variable of the loop. In this case,
    // there are three increments to "i", one of which
    // is conditional.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
        ++i;

        if (i < 100)
        {
            ++i;
        }
    }

    // To resolve code 502, ensure that there is just one
    // increment of the induction variable, placed in the usual
    // spot in the "for" loop.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

void code_503(int *A, int x)
{
    // Code 503 is emitted if there are inadmissible
    // operations in the loop - for example, exception handling and
    // switch statements.

    for (int i = 0; i<1000; ++i)
    {
        switch (x)
        {
        case 1: A[i] = A[i] + 1;
        case 2: A[i] = A[i] + 2;
        case 3: A[i] = A[i] + 3;
            break;
        }
    }

    // To resolve code 503, try to remove as many switch statements
    // and exception handling constructs as possible.
}

// compile with /EHsc

int code_504_helper();
class C504
{
public:
    C504();
    ~C504();
};

void code_504(int *A)
{
    // Code 504 is emitted if a C++ object was created and
    // that object requires EH unwind tracking information under
    // /EHs or /EHsc.

    for(int i = 0; i < 1000; ++i)
    {
        C504 c;
        A[i] = code_504_helper();
    }

}

void code_505(int *A)
{
    // Code 505 is emitted on outer loops with pre-incremented
    // induction variables. The vectorizer/parallelizer analysis
    // package doesn't support these loops, and they are
    // intentionally not converted to post-increment loops to
    // prevent a performance degradation.

    // To parallelize an outer loop that causes code 505, change
    // it to a post-incremented loop.

    for (int i=100; i--; )
        for (int j=0; j<100; j++) { // this loop is still vectorized
            A[j] = A[j] + 1;
        }                    
}

10xx-Ursachen Codes10xx reason codes

Die 10-xx -Ursachen Codes gelten für den parallelizer.The 10 xx reason codes apply to the parallelizer.

UrsachencodeReason code ErklärungExplanation
10001000 Der Compiler in der Schleife hat eine Datenabhängigkeit gefunden.The compiler detected a data dependency in the loop body.
10011001 Der Compiler hat erkannt, dass in der Schleife in einer skalaren Variablen gespeichert wird, die außerhalb der Schleife verwendet wird.The compiler detected a store to a scalar variable in the loop body, and that scalar has a use beyond the loop.
10021002 Der Compiler hat versucht, eine Schleife zu parallelisieren, die eine innere Schleife besitzt, welche bereits parallelisiert wurde.The compiler tried to parallelize a loop that has an inner loop that was already parallelized.
10031003 Die Schleife enthält einen systeminternen Aufruf, mit dem möglicherweise auf den Arbeitsspeicher zugegriffen wird.The loop body contains an intrinsic call that may read or write to memory.
10041004 Der Schleifen Text enthält eine skalare Reduzierung.There's a scalar reduction in the loop body. Skalare Reduzierung kann auftreten, wenn die Schleife vektorisiert wurde.Scalar reduction can occur if the loop has been vectorized.
10051005 Das no_parallel pragma wurde angegeben.The no_parallel pragma was specified.
10061006 Diese Funktion enthält OpenMP.This function contains OpenMP. Lösen Sie dieses Problem, indem Sie OpenMP in dieser Funktion entfernen.Resolve it by removing any OpenMP in this function.
10071007 Die Schleifen-oder Schleifen Begrenzungen sind nicht mit 32-Bit-Zahlen ( int oder long ) signiert.The loop induction variable or the loop bounds aren't signed 32-bit numbers (int or long). Beheben Sie diese, indem Sie den Typ der Einführungs Variablen ändern.Resolve it by changing the type of the induction variable.
10081008 Der Compiler hat festgestellt, dass diese Schleife nicht genügend Arbeitsvorgänge zum begründen der automatischen Parallelisierung durchführt.The compiler detected that this loop doesn't do enough work to justify auto-parallelization.
10091009 Der Compiler hat einen Versuch erkannt, eine ""-Schleife zu parallelisieren do - while .The compiler detected an attempt to parallelize a "do-while" loop. Der Auto-parallelizer hat nur " for "-Schleifen als Ziel.The auto-parallelizer only targets "for" loops.
10101010 Der Compiler hat festgestellt, dass die Schleife "Not-ist" ( != ) für die Bedingung verwendet.The compiler detected that the loop is using "not-equals" (!=) for its condition.
int A[1000];
void func();
void code_1000()
{
    // Code 1000 is emitted if the compiler detects a
    // data dependence in the loop body.

    // You can resolve this by using the ivdep pragma.
    // CAUTION -- the compiler will trust your
    // assertion that there are no data dependencies
    // in the loop body. If there are, you are generating
    // code that may have race conditions.

#pragma loop(hint_parallel(0))
    //#pragma loop(ivdep) // ivdep will force this through.
    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i-1] + 1;  // data dependence here
        func();             // data dependence here
    }
}

int code_1001()
{
    // Code 1001 is emitted if the compiler detects
    // a store to a scalar variable in the loop
    // body, and that scalar has a use beyond the loop.

    // Resolve this by rewriting your code so
    // that the scalar is not needed.

    int s = 0;
#pragma loop(hint_parallel(0))
    for (int i=0; i<1000; ++i)
    {
        s = A[i];
    }
    return s;
}

void code_1002()
{
    // Code 1002 is emitted when the compiler tries to
    // parallelize a loop that has an inner loop that
    // has already been parallelized.

#pragma loop(hint_parallel(0))
    for (int i=0; i<1000; ++i) // emit code 1002 for this loop
    {
#pragma loop(hint_parallel(0))
        for (int j=0; j<1000; ++j) // this loop gets parallelized
        {
            A[j] = A[j] + 1;
        }
    }
}

extern "C" void __stosb(unsigned char*, unsigned char, size_t);
void code_1003(unsigned char *dst)
{
    // Code 1003 is emitted when the loop body contains an intrinsic
    // call that may read or write to memory.

    // This can be resolved by using the ivdep pragma.
    // CAUTION -- the compiler will trust your
    // assertion that there are no data dependencies
    // in the loop body. If there are, you are generating
    // code that may have race conditions.

#pragma loop(hint_parallel(0))
    //#pragma loop(ivdep) // ivdep will force this through.
    for (int i=0; i<1000; ++i)
    {
        __stosb(dst, 'c', 10);
        A[i] = A[i] + 1;
    }
}

int code_1004()
{
    // Code 1004 is emitted when there is a scalar reduction
    // in the loop body, which can occur if the loop has been
    // vectorized.

    // You can resolve this by rewriting your code so that it
    // does not have a scalar reduction.

    int s = 0;
#pragma loop(hint_parallel(0))
    for (int i=0; i<1000; ++i)
    {
        s += A[i];
    }
    return s;
}

void code_1005()
{
    // Code 1005 is emitted when the
    // no_parallel pragma is specified.

#pragma loop(no_parallel)
    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

#include <omp.h>

// Compile with /openmp
void code_1006()
{
    // Code 1006 is emitted when this function contains
    // openmp. Resolve this by removing any openmp in this
    // function.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }

#pragma omp parallel num_threads(4)
    {
        int i = omp_get_thread_num();
        A[i] = A[i] + 1;
    }
}

void code_1007()
{
    // Code 1007 is emitted when the loop induction variable
    // or the loop bounds are not signed 32-bit numbers (int
    // or long). Resolve this by changing the type of the
    // induction variable.

#pragma loop(hint_parallel(0))
    for (unsigned int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

void code_1008()
{
    // Code 1008 is emitted when the compiler detects that
    // this loop does not perform enough work to warrant
    // auto-parallelization.

    // You can resolve this by specifying the hint_parallel
    // pragma. CAUTION -- if the loop does not perform
    // enough work, parallelizing might cause a potentially
    // large performance penalty.

    // #pragma loop(hint_parallel(0)) //  hint_parallel will force this through
    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

void code_1009()
{
    // Code 1009 is emitted when the compiler tries to parallelize a
    // "do-while" loop. The auto-parallelizer only targets "for" loops.

    int i = 0;
#pragma loop(hint_parallel(0))
    do
    {
        A[i] = A[i] + 1;
    }
    while (++i < 1000);
}

void code_1010()
{
    // Code 1010 is emitted when the compiler tries to parallelize a
    // loop with a condition code of "!=".

    // You can resolve this by replacing it with an ordering comparator
    // like "<".
#pragma loop(hint_parallel(0))
    for (int i = 0; i != 1000; ++i)
    {
        A[i]++;
    }
}

11xx Ursachen Codes11xx reason codes

Die 11 xx -Ursachen Codes gelten für den Vectorizer.The 11 xx reason codes apply to the vectorizer.

UrsachencodeReason code ErklärungExplanation
11001100 Die Schleife enthält die Ablauf Steuerung – z if . b. "" oder " ?: ".Loop contains control flow—for example, "if" or "?:".
11011101 Die Schleife enthält eine (möglicherweise implizite) Datentyp Konvertierung, die nicht vektorisiert werden kann.Loop contains a (possibly implicit) datatype conversion that can't be vectorized.
11021102 Die Schleife enthält nicht arithmetische oder andere nicht vektorisierbare Operationen.Loop contains non-arithmetic or other non-vectorizable operations.
11031103 Die Schleife enthält Schiebeoperationen, deren Größen innerhalb der Schleife variieren.Loop body includes shift operations whose size might vary within the loop.
11041104 Die Schleife enthält skalare Variablen.Loop body includes scalar variables.
11051105 Die Schleife enthält einen nicht erkannten Reduzierungs Vorgang.Loop includes an unrecognized reduction operation.
11061106 Die äußere Schleife ist nicht vektorisiert.Outer loop not vectorized.
void code_1100(int *A, int x)
{
    // Code 1100 is emitted when the compiler detects control flow
    // in the loop - for example, "if", the ternary operator "?", and
    // the like. Resolve this by flattening or removing control
    // flow in the loop body.

    // Not all control flow causes 1100; some is indeed
    // vectorized.

    for (int i=0; i<1000; ++i)
    {
        // straight line code is more amenable to vectorization
        if (x)
        {
            A[i] = A[i] + 1;
        }
    }
}

extern "C" int __readcr0();
void code_1102(int *A)
{
    // Code 1102 is emitted when the compiler is unable to vectorize
    // an operation in the loop body. For example, intrinsics and other
    // non-arithmetic, non-logical, and non-memory operations are not
    // vectorizable.

    // Resolve this by removing as many non-vectorizable operations
    // as possible from the loop body.

    for (int i=0; i<1000; ++i)
    {
        A[i] = __readcr0();
    }
}

void code_1103(int *A, int *B)
{
    // Code 1103 is emitted when the compiler is unable to vectorize
    // a "shift" operation. In this example, there are two shifts
    // that cannot be vectorized.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] >> B[i]; // not vectorizable

        int x = B[i];
        A[i] = A[i] >> x; // not vectorizable
    }

    // To resolve this, ensure that your shift amounts are loop
    // invariant. If the shift amounts cannot be loop invariant,
    // it may not be possible to vectorize this loop.

    int x = B[0];
    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] >> x; // vectorizable
    }
}

int code_1104(int *A, int *B)
{
    // When it vectorizes a loop, the compiler must 'expand' scalar
    // variables to a vector size such that they can fit in
    // vector registers. Code 1104 is emitted when the compiler
    // cannot 'expand' such scalars.

    // In this example, we try to 'expand' x to be used in the
    // vectorized loop. However, there is a use of 'x'
    // beyond the loop body, which prohibits this expansion.

    // To resolve this, try to limit scalars to be used only in
    // the loop body and not beyond, and try to keep their types
    // consistent with the loop types.

    int x;
    for (int i=0; i<1000; ++i)
    {
        x = B[i];
        A[i] = A[i] + x;
    }

    return x;
}

int code_1105(int *A)
{
    // The compiler performs an optimization that's known as "reduction"
    // when it operates on each element of an array and computes
    // a resulting scalar value - for example, in this piece of code, which
    // computes the sum of each element in the array:

    int s = 0;
    for (int i=0; i<1000; ++i)
    {
        s += A[i]; // vectorizable
    }

    // The reduction pattern must resemble the loop in the example. The
    // compiler emits code 1105 if it cannot deduce the reduction
    // pattern, as shown in this example:

    for (int i=0; i<1000; ++i)
    {
        s += A[i] + s;  // code 1105
    }

    // Similarly, reductions of "float" or "double" types require
    // that the /fp:fast switch is thrown. Strictly speaking,
    // the reduction optimization that the compiler performs uses
    // "floating point reassociation". Reassociation is only
    // allowed when /fp:fast is thrown.

    return s;
}

void code_1106(int *A)
{
    // Code 1106 is emitted when the compiler tries to vectorize
    // an outer loop.

    for (int i=0; i<1000; ++i) // this loop is not vectorized
    {
        for (int j=0; j<1000; ++j) // this loop is vectorized
        {
            A[j] = A[j] + 1;
        }
    }
}

12xx-Ursachen Codes12xx reason codes

Die 12-xx -Ursachen Codes gelten für den Vectorizer.The 12 xx reason codes apply to the vectorizer.

UrsachencodeReason code ErklärungExplanation
12001200 Die Schleife enthält Schleifen Daten Abhängigkeiten, die die Vektorisierung verhindern.Loop contains loop-carried data dependencies that prevent vectorization. Verschiedene Iterationen der Schleife stören einander, sodass die Vektorisierung der Schleife falsche Antworten verursachen würde, und die automatische Vektorisierung kann sich nicht selbst beweisen, dass es solche Daten Abhängigkeiten nicht gibt.Different iterations of the loop interfere with each other such that vectorizing the loop would produce wrong answers, and the auto-vectorizer can't prove to itself that there aren't such data dependencies.
12011201 Arraybasisänderungen während der Schleifenausführung.Array base changes during the loop.
12021202 Das Feld in einer Struktur ist nicht 32 oder 64 Bits breit.Field in a struct isn't 32 or 64 bits wide.
12031203 Schleife enthält nicht aufeinander folgende Zugriffe in ein Array.Loop body includes non-contiguous accesses into an array.
12041204 Limit für die interne Datenstruktur Beschränkung des Compilers: zu viele Daten Abhängigkeits Ränder.Compiler internal data structure limit hit: too many data dependence edges.
void fn();
void code_1200(int *A)
{
    // Code 1200 is emitted when data dependence is prohibiting
    // vectorization. This can only be resolved by rewriting the
    // loop, and considering the marking of loop function calls as
    // __forceinline.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i-1] + 1; // vectorization-prohibiting
        fn();               // vectorization-prohibiting
    }
}

void code_1201(int *A)
{
    // Code 1201 is emitted when an array base changes
    // in the loop body. Resolve this by rewriting your
    // code so that varying the array base is not necessary.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
        A++;
    }
}

struct S_1202
{
    short a;
    short b;
} s[1000];

short sA[1000], sB[1000], sC[1000];

void code_1202(S_1202 *s)
{
    // Code 1202 is emitted when non-vectorizable struct accesses
    // are present in the loop body. Only struct accesses
    // that are 32 or 64 bits are vectorized.

    for (int i=0; i<1000; ++i)
    {
        s[i].a = s[i].b + 1; // this 16 bit struct access is not vectorizable
        sA[i] += sB[i] * sC[i]; // this ensures we don't emit reason code '1300'
    }
}

void code_1203(int *A)
{
    // Code 1203 is emitted when non-vectorizable memory references
    // are present in the loop body. Vectorization of some non-contiguous
    // memory access is supported - for example, the gather/scatter pattern.

    for (int i=0; i<1000; ++i)
    {
        A[i] += A[0] + 1;       // constant memory access not vectorized
        A[i] += A[i*2+2] + 2;  // non-contiguous memory access not vectorized
    }
}

void code_1204(int *A)
{
    // Code 1204 is emitted when internal compiler data structures
    // hit a limit on the number of data dependence edges recorded.
    // Resolve this by moving the innermost loop to another function.

    for (int i=0; i<1000; i++)
        for (int j=0; j<1000; j++)
            for (int k=0; k<1000; k++)
                for (int l=0; l<1000; l++)
                {
                    for (int m=0; m<1000; m++)
                        A[m] = A[m+i] + A[m+j] + A[m+k] + A[m+l];
                }
}

13xx-Ursachen Codes13xx reason codes

Die 13 xx -Ursachen Codes gelten für den Vectorizer.The 13 xx reason codes apply to the vectorizer.

UrsachencodeReason code ErklärungExplanation
13001300 Der Schleifen Text enthält nur wenig oder keine Berechnung.Loop body contains little or no computation.
13011301 Schleifen Stride ist nicht + 1.Loop stride isn't +1.
13021302 Die Schleife ist " do - while ".Loop is a "do-while".
13031303 Zu wenige Schleifeniterationen für eine effektive Vektorisierung.Too few loop iterations for vectorization to provide value.
13041304 Schleife enthält Zuweisungen mit Werten unterschiedlicher Genauigkeit.Loop includes assignments that are of different sizes.
13051305 Nicht genügend Typinformationen.Not enough type information.
void code_1300(int *A, int *B)
{
    // Code 1300 is emitted when the compiler detects that there is
    // no computation in the loop body.

    for (int i=0; i<1000; ++i)
    {
        A[i] = B[i]; // Do not vectorize, instead emit memcpy
    }
}

void code_1301(int *A)
{
    // Code 1301 is emitted when the stride of a loop is not positive 1.
    // Only loops that have a stride of positive 1 are vectorized;
    // rewriting your loop may be required.

    for (int i=0; i<1000; i += 2)
    {
        A[i] = A[i] + 1;
    }
}

void code_1302(int *A)
{
    // Code 1302 is emitted for "do-while" loops. Only "while"
    // and "for" loops are vectorized.

    int i = 0;
    do
    {
        A[i] = A[i] + 1;
    } while (++i < 1000);
}

int code_1303(int *A, int *B)
{
    // Code 1303 is emitted when the compiler detects that
    // the number of iterations of the loop is too small to
    // make vectorization profitable.

    // If the loop computation fits perfectly in
    // vector registers - for example, the upper bound is 4, or 8 in
    // this case - then the loop _may_ be vectorized.

    // This loop is not vectorized because there are 5 iterations

    for (int i=0; i<5; ++i)
    {
        A[i] = A[i] + 1;
    }

    // This loop is vectorized

    for (int i=0; i<4; ++i)
    {
        A[i] = A[i] + 1;
    }

    // This loop is not vectorized because runtime pointer checks
    // are required to check that A and B don't overlap. It is not
    // worth it to vectorize this loop.

    for (int i=0; i<4; ++i)
    {
        A[i] = B[i] + 1;
    }

    // This loop is not vectorized because of the scalar reduction.

    int s = 0;
    for (int i=0; i<4; ++i)
    {
        s += A[i];
    }
    return s;
}

void code_1304(int *A, short *B)
{
    // Code 1304 is emitted when the compiler detects
    // different sized statements in the loop body.
    // In this case, there is an 32-bit statement and a
    // 16-bit statement.

    // In cases like this consider splitting the loop into loops to
    // maximize vector register utilization.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
        B[i] = B[i] + 1;
    }
}

typedef struct S_1305
{
    int a;
    int b;
} S_1305;

void code_1305( S_1305 *s, S_1305 x)
{
    // Code 1305 is emitted when the compiler can't discern
    // proper vectorizable type information for this loop.
    // This includes non-scalar loop types such as struct
    // assignments, as in this example.

    // Resolve this by ensuring that your loops have statements
    // that operate on integers or floating point types.

    for (int i=0; i<1000; ++i)
    {
        s[i] = x;
    }
}

14xx-Ursachen Codes14xx reason codes

Die 14 xx -Ursachen Codes treten auf, wenn eine Option angegeben ist, die nicht mit Vektorisierung kompatibel ist.The 14 xx reason codes occur when some option that is incompatible with vectorization is specified.

UrsachencodeReason code ErklärungExplanation
14001400 #pragma loop(no_vector) ist angegeben.#pragma loop(no_vector) is specified.
14011401 /kernel-Schalter ist angegeben, während auf x86 oder ARM abgezielt wird./kernel switch is specified when targeting x86 or ARM.
14021402 /arch:SSE2 der Schalter wird bei x86 nicht als Ziel festgelegt./arch:SSE2 or higher switch isn't specified when targeting x86.
14031403 /arch:ATOM der Schalter ist angegeben, und die Schleife umfasst Vorgänge für doppelte./arch:ATOM switch is specified and the loop includes operations on doubles.
14041404 /O1 oder /Os Switch ist angegeben./O1 or /Os switch is specified.
14051405 Vektorisierung wird deaktiviert, um die Optimierungsumwandlung dynamischer Initialisierer in statische Initialisierer zu unterstützen.Vectorization is disabled to aid in dynamic-initializer-to-static-initializer optimization.
void code_1400(int *A)
{
    // Code 1400 is emitted when the no_vector pragma
    // is specified.

#pragma loop(no_vector)
    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

// Compile with /kernel
void code_1401(int *A)
{
    // Code 1401 is emitted when /kernel is specified.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

// Compile with /arch:IA32
void code_1402(int *A)
{
    // Code 1401 is emitted when /arch:IA32 is specified.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

// Compile with /favor:ATOM
void code_1403(double *A)
{
    // Code 1401 is emitted when /favor:ATOM is specified, and
    // the loop contains operations on "double" arrays.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

// Compile with /O1 or /Os
void code_1404(int *A)
{
    // Code 1401 is emitted when compiling for size.

    for (int i=0; i<1000; ++i)
    {
        A[i] = A[i] + 1;
    }
}

15xx-Ursachen Codes15xx reason codes

Die 15-xx -Ursachen Codes gelten für Aliasing.The 15 xx reason codes apply to aliasing. Aliasing tritt auf, wenn auf einen Speicherort im Arbeitsspeicher unter zwei unterschiedlichen Namen zugegriffen werden kann.Aliasing occurs when a location in memory can be accessed by two different names.

UrsachencodeReason code ErklärungExplanation
15001500 Mögliches Aliasing auf mehrdimensionale Arrays.Possible aliasing on multi-dimensional arrays.
15011501 Mögliches Aliasing auf Arrays von Strukturen.Possible aliasing on arrays-of-structs.
15021502 Mögliches Aliasing, und Arrayindex ist nicht n + K.Possible aliasing and array index is other than n + K.
15031503 Mögliches Aliasing, und Arrayindex hat mehrere Offsets.Possible aliasing and array index has multiple offsets.
15041504 Mögliches Aliasing; würde zu viele Laufzeitüberprüfungen benötigen.Possible aliasing; would require too many runtime checks.
15051505 Mögliches Aliasing, aber Laufzeitüberprüfungen sind zu komplex.Possible aliasing, but runtime checks are too complex.
void code_1500(int A[100][100], int B[100][100])
{
    // Code 1500 is emitted when runtime pointer
    // disambiguation checks are required, and
    // there are multidimensional array references.

    for (int i=0; i<100; ++i)
    {
        for (int j=0; j<100; ++j)
        {
            A[i][j] = B[i][j] + 1;
        }
    }
}

typedef struct S_1501
{
    int a;
    int b;
} S_1501;

int iA[1000], iB[1000], iC[1000];

void code_1501(S_1501 *s1, S_1501 *s2)
{
    // Code 1501 is emitted when runtime pointer
    // disambiguation checks are required, and
    // there are array-of-struct accesses in the
    // loop body.

    for (int i=0; i<100; ++i)
    {
        s1[i].a = s2[i].b + 1;
        iA[i] += iB[i] * iC[i]; // this is to ensure we don't emit reason code '1300'
    }
}

void code_1502(int *A, int *B)
{
    // Code 1502 is emitted when runtime pointer
    // disambiguation checks are required, and
    // an array reference has an offset that varies
    // in the loop.

    int x = 0;
    for (int i=0; i<100; ++i)
    {
        A[i] = B[i + x] + 1;
        ++x;                   // 'x' varies in the loop
    }
}

void code_1503(int *A, int *B, int x, int y)
{
    // Code 1503 is emitted when runtime pointer
    // disambiguation checks are required, and
    // an array reference has multiple offsets.

    for (int i=0; i<100; ++i)
    {
        A[i] = B[i+x] + B[i+y] + 1;   // multiple offsets when addressing 'B': {x, y}
        A[i] = B[i+x] + B[i] + 1;     // multiple offsets when addressing 'B': {x, 0}
        A[i] = B[i+x] + B[i+x] + 1;   // this is vectorized
    }
}

void code_1504(int *A1, int *A2, int *A3, int *A4,
               int *A5, int *A6, int *A7, int *A8,
               int *A9, int *A10, int *A11, int *A12,
               int *A13, int *A14, int *A15, int *A16)
{
    // Code 1504 is emitted when too many runtime
    // pointer disambiguation checks are required.

    for (int i=0; i<100; ++i)
    {
        ++A1[i];
        ++A2[i];
        ++A3[i];
        ++A4[i];
        ++A5[i];
        ++A6[i];
        ++A7[i];
        ++A8[i];
        ++A9[i];
        ++A10[i];
        ++A11[i];
        ++A12[i];
        ++A13[i];
        ++A14[i];
        ++A15[i];
        ++A16[i];
    }
}

void code_1505(int *A, int *B)
{
    // Code 1505 is emitted when runtime pointer
    // disambiguation checks are required, but are
    // too complex for the compiler to discern.

    for (int i=0; i<100; ++i)
    {
        for (int j=0; j<100; ++j)
        {
            for (int k=0; k<100; ++k)
            {
                A[i+j-k] = B[i-j+k] * 2;
            }
        }
    }
}

Weitere InformationenSee also

Fehler und Warnungen für C/C++-Compiler und BuildtoolsC/C++ Compiler and build tools errors and warnings
Automatische Parallelisierung und automatische VektorisierungAuto-parallelization and auto-vectorization
Automatische Vektorisierung in Visual Studio 2012 – ÜbersichtAuto-Vectorizer in Visual Studio 2012 – Overview
#pragma loop()
/Q Optionen (Vorgänge auf niedriger Ebene)/Q Options (Low-Level Operations)
/Qpar-report (Berichts Ebene für die automatische Parallelisierung)/Qpar-report (Auto-Parallelizer Reporting Level)
/Qvec-report (Bericht Ebene für die automatische Vektorisierung)/Qvec-report (Auto-Vectorizer Reporting Level)