Visible to Intel only — GUID: GUID-71FBA8B7-28E3-46C0-99F9-75D2958994C3
Visible to Intel only — GUID: GUID-71FBA8B7-28E3-46C0-99F9-75D2958994C3
qopt-streaming-stores, Qopt-streaming-stores
Enables generation of streaming stores for optimization.
Syntax
Linux: |
-qopt-streaming-stores=keyword -qno-opt-streaming-stores |
Windows: |
/Qopt-streaming-stores:keyword /Qopt-streaming-stores- |
Arguments
keyword |
Specifies whether streaming stores are generated. Possible values are:
|
Default
-qopt-streaming-stores=auto |
The compiler decides whether to use streaming stores or normal stores. |
Description
This option enables generation of streaming stores for optimization. This method stores data with instructions that use a non-temporal buffer, which minimizes memory hierarchy pollution.
This option may be useful for applications that can benefit from streaming stores.
IDE Equivalent
Alternate Options
None
Example
The following example shows one way to insert memory barriers (fences) when specifying -qopt-streaming-stores=always or /Qopt-streaming-stores:always. It uses the procedure interface for_sfence from the module IFCORE, which maps to the C/C++ function _mm_sfence:
program main
implicit none
INTEGER, PARAMETER :: dp = selected_real_kind(15, 307)
integer, parameter :: k5 = selected_int_kind(5)
integer, parameter :: k15 = selected_int_kind(15)
integer (kind=k5), parameter :: i5 = 10
integer (kind=k15) :: i15
integer (kind=k15) :: sizeof
REAL (KIND=dp) :: a(i5)
REAL (KIND=dp) :: b(i5)
REAL (KIND=dp) :: c(i5)
sizeof = size(a)
call sub1(a,b,c,sizeof,sizeof,sizeof)
contains
subroutine sub1(a, b, c, lent, n1, n2)
use IFCORE, only : for_sfence
integer (kind=k15) lent, n1, n2, i, j
REAL (KIND=dp) a(lent), b(lent), c(lent), d(lent)
!$omp parallel do
do j = 1, n1
a(j) = 1.0 *j
b(j) = 2.0 * j*j
c(j) = 3.0 *j * j*j
enddo
!$omp end parallel do
call for_sfence()
!$omp parallel do
do i = 1, n2
a(i) = a(i) + b(i) * c(i)
write(*,*)a(i)
enddo
!$omp end parallel do
end subroutine
end