# qopt-streaming-stores, Qopt-streaming-stores

Enables generation of streaming stores for optimization.

## Syntax

Linux: | -qopt-streaming-stores=keyword -qno-opt-streaming-stores

macOS: | -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:
always | Enables generation of streaming stores for optimization. The compiler optimizes under the assumption that the application is memory bound. When this option setting is specified, it is your responsibility to also insert any memory barriers (fences) as required to ensure correct memory ordering within a thread or across threads. See the Examples section for one way to do this.
never | Disables generation of streaming stores for optimization. Normal stores are performed. This setting has the same effect as specifying -qno-opt-streaming-stores or /Qopt-streaming-stores-.
auto | Lets the compiler decide which instructions to use.

## Default

-qopt-streaming-stores=auto or /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

None

## 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:

    subroutine sub1(a, b, c, len, n1, n2)
    use IFCORE, only : for_sfence
    integer len, n1, n2, i, j
    real(8) a(len), b(len), c(len), d(len)

      !$omp parallel do
      do j = 1, n1
         a(j) = 1.0
         b(j) = 2.0
         c(j) = 3.0
      enddo
      !$omp end parallel do

    call ftn_sfence()

      !$omp parallel do
      do i = 1, n2
         a(i) = a(i) + b(i) * c(i)
      enddo
      !$omp end parallel do

    end

Parent topic: Advanced Optimization Options

## See Also

ax, Qax compiler option
x, Qx compiler option