copapy.Target#

class copapy.Target(arch='native', optimization='O3')#

Bases: object

Target device for compiling for and running on copapy code.

Initialize Target object

Parameters:
  • arch (str) – Target architecture

  • optimization (str) – Optimization level

compile(*values)#

Compiles the code to compute the given values.

Parameters:

values (int | float | value[Any] | Iterable[int | float | value[Any]]) – Values to compute

Return type:

None

read_value(variables)#

Reads the numeric value of a copapy type.

Parameters:

variables (value[int] | value[float] | int | float | value[TypeVar(T, int, float)] | Iterable[TypeVar(T, int, float) | value[TypeVar(T, int, float)]]) – Variable or multiple variables to read

Return type:

Any

Returns:

Numeric value or values

read_value_remote(variable)#

Reads the raw data of a value by the runner.

Return type:

None

run()#

Runs the compiled code on the target device.

Return type:

None

write_value(variables, data)#

Write to a copapy value on the target.

Parameters:
  • variables (value[Any] | Iterable[value[Any]]) – Singe variable or multiple variables to overwrite

  • value – Singe value or multiple values to write

Return type:

None