WSE Global Scalar Module

The WSE Global Scalar Module is designed to handle global, mutable scalars in the WFA. Global scalars live in the memory space of the controller and are broadcast with the arguments when an operation is evoked. This approach conserves memory on the system and incurs minimal latencies. It is most commonly used in calculating dot products in linear solvers. The Module supports a limited but growing number of scalar-scalar operations. These operations are conducted on the controller tile.

class WFA.WSE_Global_Scalar.WSE_Global_Scalar(name='scalar', **kwargs)

Handles mathmatics with global scalars. Data lives on Control Tile.

copy(other)

Copies the value in other to self

In this example two values are instantiated. The value of x is then copied to y.

x = WSE_Global_Scalar(value=2.0)
y = WSE_Global_Scalar()

y.copy(x)
Parameters:

other (WSE_Global_Scalar) – The value to copy.

Raises:

ValueError – Only supports WSE_Global_Scalar data types.

Return type:

None.

max_with(other)

Computes the maximum between self and other.

In this example two values are instantiated. The value of x is then max_with with y. The maximum value (in this case y) is assigned to z.

x = WSE_Global_Scalar(value=1.0)
y = WSE_Global_Scalar(value=2.0)

z = x.max_with(y)
Parameters:

other (WSE_Global_Scalar) – The value to max with.

Raises:

ValueError – Only supports scalar data types: WSE_Global_Scalar, float and integer.

Returns:

result – The maximum value of self and other.

Return type:

WSE_Global_Scalar

min_with(other)

Computes the minimum between self and other.

In this example two values are instantiated. The value of x is then min_with with y. The maximum value (in this case x) is assigned to z.

x = WSE_Global_Scalar(value=1.0)
y = WSE_Global_Scalar(value=2.0)

z = x.min_with(y)
Parameters:

other (WSE_Global_Scalar) – The value to min with.

Returns:

result – The minimum value of self and other.

Return type:

WSE_Global_Scalar

setValue(value)

Sets a WSE_Global_Scalar to a float value.

In this example a scalar is instantiated with a value of 0. The value is then set to 0.01.

x = WSE_Global_Scalar()

x.setValue(0.01)
Parameters:

value (float, int) – The desired value for the scalar.

Return type:

None.