copapy.Target#
- class copapy.Target(arch='native', optimization='O3')#
Bases:
objectTarget device for compiling for and running on copapy code.
Initialize Target object
- Parameters:
arch (
str) – Target architectureoptimization (
str) – Optimization level
- compile(*values)#
Compiles the code to compute the given values.
- read_value(variables)#
Reads the numeric value of a copapy type.
- Overloads:
self, variables (value[T]) → T
self, variables (NumLike) → float | int | bool
self, variables (Iterable[T | value[T]]) → list[T]
self, variables (ArrayType[T]) → ArrayType[T]
- Parameters:
variables (
value[int] |value[float] |int|float|value[TypeVar(T,int,float)] |ArrayType[TypeVar(T,int,float)] |Iterable[TypeVar(T,int,float) |value[TypeVar(T,int,float)]]) – Variable or multiple variables to read- 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