Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Function vs subroutine

drob__douglas
Beginner
991 Views
Are functions intrisically faster or easier for the intel comiler to optimize (e.g. inlining) as compared to subroutines?
- Doug
0 Kudos
4 Replies
Steven_L_Intel1
Employee
991 Views
No. If your function or subroutine is PURE, that can help.
0 Kudos
Intel_C_Intel
Employee
991 Views
What does purity of function or subroutinegive to compiler for optimization?
0 Kudos
Steven_L_Intel1
Employee
991 Views
PURE specifies that the procedure has no side effects. For a function, it also specifies that the arguments are not stored to.
0 Kudos
drob__douglas
Beginner
991 Views
Thanks for the answer. Makes sense.
- Doug
0 Kudos
Reply