- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I have a question about the newly implemented parameterized derived types language feature:
If I use a KIND type parameter when specifying array DIMENSIONs of a DT component, and write special (typically type-bound) procedures for this PDT that operate on the said array component, will the compiler be able to optimize performance in any way due to array dimensions being known at compile time for all instances of the type?
Of course one could do the same without PDTs by just using a (global) PARAMETER in the declaration of the array dummy arguments and the array variables, but I guess that it would be much easier for the compiler til reason about this when it is "formalized" through a DT..?
PS: the array(-component)s I'm talking about here would typically be small; in the range 2x2 to 16x16
PS2: really looking forward to finally use PDTs!!!!
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Yes, you can do that. It's even an example in the standard (Note 4.23 in F2008). For optimization, it's no different than using a PARAMETER in the bounds expression.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Can I interpret your reply to imply that procedures with array arguments of given/constant shape are actually optimized compared to if assume-shape dummies were used?
And, as we're on the subject; is there a difference (in speed/overhead/?) between assumed-shape and explicit-shape (where array bounds are passed as arguments) dummies?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Anytime information is deferred to run-time, there's a performance penalty. How large that is depends a lot on the application. Explicit shape arrays with bounds as dummy arguments are barely different from assumed-shape (except that the compiler knows the stride is always 1.)
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla