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.
Optimization Notice |
---|
Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 |
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
Copyright © 1996-2011, Intel Corporation. All rights reserved.