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:
|
||||||||||
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:
The return type of the function, if the function has a return type.
The data type of the first non-scalar argument (that is, the first argument that is specified in the scalar clause), if any.
Default integer type, if neither of the above is supplied.
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.
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. 無断での引用、転載を禁じます。