Files
concrete/docs/dev/api/concrete.compiler.md
2024-12-24 14:08:08 +01:00

97 lines
2.9 KiB
Markdown

<!-- markdownlint-disable -->
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/compiler/__init__.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
# <kbd>module</kbd> `concrete.compiler`
Compiler submodule.
**Global Variables**
---------------
- **utils**: # Part of the Concrete Compiler Project, under the BSD3 License with Zama Exceptions.
# See https://github.com/zama-ai/concrete/blob/main/LICENSE.txt for license information.
- **compilation_feedback**: # Part of the Concrete Compiler Project, under the BSD3 License with Zama Exceptions.
# See https://github.com/zama-ai/concrete/blob/main/LICENSE.txt for license information.
- **compilation_context**: # Part of the Concrete Compiler Project, under the BSD3 License with Zama Exceptions.
# See https://github.com/zama-ai/concrete/blob/main/LICENSE.txt for license information.
- **tfhers_int**
---
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/compiler/__init__.py#L58"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `init_dfr`
```python
init_dfr()
```
Initialize dataflow parallelization.
It is not always required to initialize the dataflow runtime as it can be implicitely done during compilation. However, it is required in case no compilation has previously been done and the runtime is needed
---
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/compiler/__init__.py#L67"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `check_gpu_enabled`
```python
check_gpu_enabled() bool
```
Check whether the compiler and runtime support GPU offloading.
GPU offloading is not always available, in particular in non-GPU wheels.
---
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/compiler/__init__.py#L74"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `check_gpu_available`
```python
check_gpu_available() bool
```
Check whether a CUDA device is available and online.
---
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/compiler/__init__.py#L84"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>function</kbd> `round_trip`
```python
round_trip(mlir_str: str) str
```
Parse the MLIR input, then return it back.
Useful to check the validity of an MLIR representation
**Args:**
- <b>`mlir_str`</b> (str): textual representation of an MLIR code
**Raises:**
- <b>`TypeError`</b>: if mlir_str is not of type str
**Returns:**
- <b>`str`</b>: textual representation of the MLIR code after parsing