Re: Logical handling
Dieter Britz wrote:
I want to handle matrices of type logical, and I reckon that
these ought to be done faster than the equivalent integer
matrices with MOD(*,2) hung on. However, on my Intel compiler,
the two came out almost exactly the same in cpu time. Clearly,
logicals are stored in whole words, rather than bits.
Is this general for compilers, or is it an Intel thing?
--
It's general on virtually any existing processor. For Fortran LOGICAL
is, as you note, equivalent in length to INTEGER and does not have an
intrinsic bit type. Since Intel processors in particular (and
virtually all in general) are word- or byte-addressable, the faster
operation(s) are on words, and addressing individual bits would, if
implemented, be more compute-intensive than the equivalent word
operation(s).
As for the difference between direct use of LOGICAL and INTEGER w/
MOD() not showing significant difference, that is probably owing to the
optimization by the compiler and the size/structure of the test(s).
.
Relevant Pages
- Re: Logical handling
... logicals are stored in whole words, ... or is it an Intel thing? ... MODnot showing significant difference, that is probably owing to the ... optimization by the compiler and the size/structure of the test. ... (comp.lang.fortran) - Re: Logical handling
... logicals are stored in whole words, ... or is it an Intel thing? ... a logical spanning a byte involves the same memory bandwidth as ... optimization by the compiler and the size/structure of the test. ... (comp.lang.fortran) - Call for Participation: CGO-5, 11-14 March 2007 - San Jose, California / Online Regist
... Programming a Massively Parallel Processor" ... Workshop on EPIC Architectures and Compiler Technology ... Code Generation and Optimization for Transactional Memory Constructs ... Cheng Wang (Intel Corporation), Wei-Yu Chen ... (comp.programming) - Re: Question about intel_VEC_memcpy
... Syntax such as array assignment and matmul() is highly productive of temporaries, some of which could be avoided by better optimization in the compiler. ... If you are willing to work with a current version of ifort, and to submit a case to Intel support, there is likely to be scope for improvement. ... a compiler can't avoid the allocation of a temporary array for the intermediate result. ... (comp.lang.fortran) - Re: New Visual Fortran Product Survey
... I assume that MS authorized DEC to use the name, and that that authorization transferred to Compaq/HP and then to Intel when the compiler/components/rights were successively purchased by those companies. ... HP does own and retain the rights to DEC/Compaq Visual Fortran, and their disuse of it does not give anyone else a right to use it. ... I believe the wording which says the product is only for Windows X64 EM64T and AMD64, for which only a minority of the vendors mentioned above have a product. ... I would expect most of the above vendors to produce such a compiler for whatever architecture becomes predominant, ... (comp.lang.fortran) |
|