ATTRIBUTES VECTOR

The ATTRIBUTES directive option VECTOR tells the compiler to vectorize the specified function or subroutine. It takes one of the following forms:

構文

cDEC$ ATTRIBUTES [att,] VECTOR [:clause] [, att]... :: routine-name

cDEC$ ATTRIBUTES [att,] VECTOR :(clause [, clause]...) [, att] :: routine-name

c

Is one of the following: C (or c), !, or *. (See Syntax Rules for Compiler Directives.)

att

Is an ATTRIBUTES directive option. For a list of possible directive options, see the description of argument att in ATTRIBUTES.

clause

Is one or more of the following optional clauses:

  • LINEAR (var1:step1 [, var2:step2]... )

    var

    Is a scalar variablethat is a dummy argument in the specified routine.

    step

    Is a compile-time positive, integer constant expression.

    Tells the compiler that for each consecutive invocation of the routine in a serial execution, the value of var1 is incremented by step1, var2 is incremented by step2, and so on.

    If more than one step is specified for a particular var, a compile-time error occurs.

    Multiple LINEAR clauses are merged as a union.

  • [NO]MASK

    Determines whether the compiler generates a masked vector version of the routine.

  • PROCESSOR (cpuid [, cpuid]…)

    cpuid

    Can be any of the following keywords:

    pentium_4

    pentium_m

    pentium_4_sse3

    core_2_duo_ssse3

    core_2_duo_sse4_1

    atom

    core_i7_sse4_2

    core_aes_pclmulqdq

    core_2nd_gen_avx

    lrb

    Tells the compiler to create a vector version of the routine for the specified processor.

    The vector version of the routine that is created by the compiler is not affected by processor options specified on the command line.

    When running on a processor that does not match cpuid, a scalar version will be invoked multiple times based on vector length.

    Multiple PROCESSOR clauses are merged as a union.

  • SCALAR (arg [, arg]…)

    arg

    Is a scalar variable that is a dummy argument in the specified routine.

    Tells the compiler that the values of the specified arguments can be broadcasted to all iterations as a performance optimization.

    Multiple SCALAR clauses are merged as a union.

  • VECTORLENGTH (n[, n]…)

    n

    Is a vector length (VL). It must be an integer, scalar constant expression that is a power of 2; the value must be 2, 4, 8, or 16. If you specify more than one n, the compiler will choose the VL from the values specified.

    Tells the compiler that each routine invocation at the call site should execute the computation equivalent to n times the scalar function execution.

    Multiple VECTORLENGTH clauses are merged as a union.

routine-name

Is the name of a routine (a function or subroutine). It must be the enclosing routine or the routine immediately following the directive.

If you specify more than one clause, they must be separated by commas and enclosed in parentheses.

When you specify the cDEC$ ATTRIBUTES VECTOR directive, the compiler provides data parallel semantics by combining with the vectorized operations or loops at the call site. When multiple instances of the vector declaration are invoked in a parallel context, the execution order among them is not sequenced. If you specify one or more clauses, they affect the data parallel semantics provided by the compiler.

If you specify thecDEC$ ATTRIBUTES VECTOR directive with no VECTORLENGTH clause, a default VECTORLENGTH is computed based on efficiency heuristics of the vectorizer and the following:

If you specify the cDEC$ ATTRIBUTES VECTOR directive with no clause, the compiler will generate vector code based on compiler efficiency heuristics and whatever processor compiler options are specified.

Note icon

You should ensure that any possible side effects for the specified routine-name are acceptable or expected, and the memory access interferences are properly synchronized.

最適化に関する注意事項

インテル® コンパイラー、関連ライブラリーおよび関連開発ツールには、インテル製マイクロプロセッサーおよび互換マイクロプロセッサーで利用可能な命令セット (SIMD 命令セットなど) 向けの最適化オプションが含まれているか、あるいはオプションを利用している可能性がありますが、両者では結果が異なります。また、インテル® コンパイラー用の特定のコンパイラー・オプション (インテル® マイクロアーキテクチャーに非固有のオプションを含む) は、インテル製マイクロプロセッサー向けに予約されています。これらのコンパイラー・オプションと関連する命令セットおよび特定のマイクロプロセッサーの詳細は、『インテル® コンパイラー・ユーザー・リファレンス・ガイド』の「コンパイラー・オプション」を参照してください。インテル® コンパイラー製品のライブラリー・ルーチンの多くは、互換マイクロプロセッサーよりもインテル製マイクロプロセッサーでより高度に最適化されます。インテル® コンパイラー製品のコンパイラーとライブラリーは、選択されたオプション、コード、およびその他の要因に基づいてインテル製マイクロプロセッサーおよび互換マイクロプロセッサー向けに最適化されますが、インテル製マイクロプロセッサーにおいてより優れたパフォーマンスが得られる傾向にあります。

インテル® コンパイラー、関連ライブラリーおよび関連開発ツールは、互換マイクロプロセッサー向けには、インテル製マイクロプロセッサー向けと同等レベルの最適化が行われない可能性があります。これには、インテル® ストリーミング SIMD 拡張命令 2 (インテル® SSE2)、インテル® ストリーミング SIMD 拡張命令 3 (インテル® SSE3)、ストリーミング SIMD 拡張命令 3 補足命令 (SSSE3) 命令セットに関連する最適化およびその他の最適化が含まれます。インテルでは、インテル製ではないマイクロプロセッサーに対して、最適化の提供、機能、効果を保証していません。本製品のマイクロプロセッサー固有の最適化は、インテル製マイクロプロセッサーでの使用を目的としています。

インテルでは、インテル® コンパイラーおよびライブラリーがインテル製マイクロプロセッサーおよび互換マイクロプロセッサーにおいて、優れたパフォーマンスを引き出すのに役立つ選択肢であると信じておりますが、お客様の要件に最適なコンパイラーを選択いただくよう、他のコンパイラーの評価を行うことを推奨しています。インテルでは、あらゆるコンパイラーやライブラリーで優れたパフォーマンスが引き出され、お客様のビジネスの成功のお役に立ちたいと願っております。お気づきの点がございましたら、お知らせください。

改訂 #20110307

The ATTRIBUTES VECTOR directive can appear in the declaration of the routine; for example:

   function f(x)
!DEC$ attributes vector :: f

The ATTRIBUTES VECTOR directive can also appear in the code of the caller; for example:

   main m
   integer f
   external f
!dec$ attributes vector :: f   ! or it can be in an interface block describing f
   ...
   print *, f(x)

You can also specify this directive with other ATTRIBUTE settings; for example:

!DEC$ ATTRIBUTES VECTOR, C :: F

This sets both the VECTOR and C attributes for routine F.

You can specify more than one PROCESSOR, SCALAR, or LINEAR clause in an ATTRIBUTES VECTOR directive. For example, all of the following are valid:

!DEC$ ATTRIBUTES VECTOR:PROCESSOR(atom) :: f
!DEC$ ATTRIBUTES VECTOR:(PROCESSOR(atom), PROCESSOR(core_i7_sse4_2)) :: f
 
!DEC$ ATTRIBUTES VECTOR:PROCESSOR(atom, core_i7_sse4_2) :: f
!DEC$ ATTRIBUTES VECTOR:(SCALAR(a), SCALAR(b)) :: f
!DEC$ ATTRIBUTES VECTOR:(LINEAR(x:1), LINEAR(y:1)) :: f

The three directives above are equivalent to specifying a single, continued, directive in fixed-form source, as follows:

!DEC$ ATTRIBUTES VECTOR:( PROCESSOR(atom, core_i7_sse4_2),
!DEC$& SCALAR(a, b), 
!DEC$& LINEAR(x:1, y:1) ) :: f

関連情報


このヘルプトピックについてのフィードバックを送信

© 1996-2011 Intel Corporation. 無断での引用、転載を禁じます。