Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussões

Penalty associated with the use of allocatable arrays in derived types

OP1
Novo colaborador III
474 Visualizações

Steve,

A month or so ago there was a thread about using allocatable arrays in derived types (click here). In one of your contributions to this thread you said: "In the case of allocatable or pointer array components of derived type, a temporary may be made."
My code makes a heavy use of allocatable arrays within nested derived types, due to a fairly complex set of input data. I have for instance allocatable arrays of derived-type variables, which in turn also have derived type components. A simple example would be A(i)%B(C(j)%D(k)) = p, for instance.

Can you elaborate a bit more on the "may" in your answer? Also, does the /check:arg_temp_created run-time option work for derived type structures?

Is a temporary only created when some part of the derived type variable is assigned a value? If I only use the derived type variable as an input, would a temporary be created?

Thanks,

Olivier

0 Kudos
1 Responder
Steven_L_Intel1
Funcionário
474 Visualizações
The temporary copy might be made if you assign a value to one of these array components. I don't think I can list all the cases where this can happen, and I also don't think that /check:arg_temp_created will identify these.
Responder