Instead of overriding the process stderr to get
the string representation from mlir we can can
directly capture in into a string using mlir's
printOperation.
Another problem with overriding stderr is that
each `#[test]` runs as a different thread meaning that
as soon as we have 2+ tests the tests could panic
due to conflicts/races between the different overrides.
This also moves the expected string directly into the test
as a literal.
The rust bindings are intented to access both LLVM/MLIR CAPI as well as
the concrete-compiler one. This initial commit provide the API for
LLVM/MLIR only. Tests should be used as an example to how to generate a
valid DAG of operations in MLIR.
- unify CPU and GPU bootstrapping operations
- remove operations to build GLWE from table: this is now done in
wrapper functions
- remove GPU memory management operations: done in wrappers now, but we
will have to think about how to deal with it later in MLIR
When building the ServerLib before any other concretelang target that
depends on `mlir-headers`, compilation fails due to missing include
files generated by tablegen, e.g., `llvm/IR/Attributes.inc`.
This adds a dependency from ServerLib to `mlir-headers`, which forces
the generation of the missing header files.
This patch adds support for scalar results to the client/server
protocol and tests. In addition to `TensorData`, a new type
`ScalarData` is added. Previous representations of scalar values using
one-dimensional `TensorData` instances have been replaced with proper
instantiations of `ScalarData`.
The generic use of `TensorData` for scalar and tensor values has been
replaced with uses of a new variant `ScalarOrTensorData`, which can
either hold an instance of `TensorData` or `ScalarData`.
Returning tensors with elements whose width is not equal to 64 results
in garbled data. This commit extends the `TensorData` class used to
represent tensors in JIT compilation with support for signed /
unsigned elements of 8/16/32 and 64 bits, such that all clear text
tensors with up to 64 bits can be represented accurately.
The bufferization of the BConcrete dialect emits calls to Concrete
wrapper functions and casts all memrefs to ranked memrefs with dynamic
strides and an implicit identity layout map. The implicit identity map
does not allow for casts of memrefs with non-zero offsets, e.g.,
resulting from folding of memrefs related to intermediate results
passed as operands to the operation implemented by a wrapper.
Casting to memrefs symbolic offsets in the layout map (e.g.,
`[d0, d1, ...](s0, s1, ...) -> (d0 + s0, d1 + s1, ...)`) allows
for more flexibility, in particular this adds support for memrefs
with non-zero, constant offsets returned by operations generating
intermediate results.
Starting from Mac 11 (Big Sur), it appears we need to add -L
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem for the
sharedlib to link properly.i