- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Which is faster, in place operations or not in place operations?
e.x.
c = a + b
or
a = a + b
How would I use Allocateso thatthe address of the first element of an arrayis divisible in bytes by 16, 32 or 64?
e.x.
c = a + b
or
a = a + b
How would I use Allocateso thatthe address of the first element of an arrayis divisible in bytes by 16, 32 or 64?
1 Решение
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Your first question does not have a simple answer, other than "It depends". My advice is to write the code that is clearest to you and let the compiler worry about optimization. If you're talking scalars, I doubt you could ever detect a difference between these - with arrays, you might get into memory bandwidth issues with a separate target.
You can request alignment of allocatable variables by adding the directive:
!DEC$ ATTRIBUTES ALIGN:16 :: varname
replace 16 by 32 or 64 or whatever reasonable power of 2 you want. See the documentation on this directive for more details.
You can request alignment of allocatable variables by adding the directive:
!DEC$ ATTRIBUTES ALIGN:16 :: varname
replace 16 by 32 or 64 or whatever reasonable power of 2 you want. See the documentation on this directive for more details.
Ссылка скопирована
2 Ответы
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Your first question does not have a simple answer, other than "It depends". My advice is to write the code that is clearest to you and let the compiler worry about optimization. If you're talking scalars, I doubt you could ever detect a difference between these - with arrays, you might get into memory bandwidth issues with a separate target.
You can request alignment of allocatable variables by adding the directive:
!DEC$ ATTRIBUTES ALIGN:16 :: varname
replace 16 by 32 or 64 or whatever reasonable power of 2 you want. See the documentation on this directive for more details.
You can request alignment of allocatable variables by adding the directive:
!DEC$ ATTRIBUTES ALIGN:16 :: varname
replace 16 by 32 or 64 or whatever reasonable power of 2 you want. See the documentation on this directive for more details.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Thank you.

Ответить
Параметры темы
- Подписка на RSS-канал
- Отметить тему как новую
- Отметить тему как прочитанную
- Выполнить отслеживание данной Тема для текущего пользователя
- Закладка
- Подписаться
- Страница в формате печати