GpuLaneBroadcast

The value an expression has in the first lane of the iteration.

Declaration

Sintaxe

GpuLaneBroadcast(expr arg, ttype type, expr? value)

Argumentos

Argument

Descrição

arg

an integer, real or logical scalar.

type

the type of arg.

value

always nil.

Valores de retorno

The value arg has in lane zero of the running thread’s iteration.

Descrição

In a kernel whose layout has lanes (see gpu_kernel_layout), a statement that must not be repeated by every lane of an iteration – it writes memory the lanes share, or takes elements of the device heap – runs on the first lane only. Each lane holds its own copy of a scalar local, so after the statement every lane takes the scalars it assigned from the first one: x = GpuLaneBroadcast(x). Every lane of the iteration evaluates it at the same point. Only such a kernel has one.

Exemplos

(GpuLaneBroadcast
  (Var 2 x)
  (Integer
    :kind 4
  )
  ()
)

Veja Também

GpuLaneIndex, GpuLaneBroadcast, GpuLaneBarrier, gpu_kernel_layout