Skip to content

bruno-ah-um/LLVM-MLIR-TOSA-Experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLVM-MLIR-TOSA-Experiments

Experiments with the TOSA (Tensor Operator Set Architecture) Dialect of LLVM MLIR, including a C library for FFI integration.

Components

  • C++ Example (mlir_tosamain.cpp): Direct C++ example creating MLIR TOSA operations
  • C Library (libmlir_tosa_c.so): C wrapper exposing MLIR TOSA functionality through a pure C API
  • C Example (mlir_tosaexample_c_client.c): Demonstrates using the C library

Purpose

The C library enables integration with languages that have C FFI support (Java, Python, Rust, etc.) without requiring C++ bindings. The header file (mlir_tosa_c_api.h) can be used with binding generators like JNA, jextract, or ctypes.

Quick Start

# 0. Go to library directory
cd mlir-tosa

# 1. Configure (auto-detects LLVM/MLIR)
./configure.sh

# 2. Build
cmake --build build

# 3. Compile TOSA to native code
./compile_to_native_optimized.sh

# 4. Test
./test_native_lib

About

Some experiments with the TOSA Dialect of LLVM MLIR

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors