Skip to content

Expand stable C API (c_api.rs & include/oxideon.h) and add a C/C++ CMake example #5

Done

Description

@voidstackloop

Summary

crates/oxideon-core/src/c_api.rs and include/oxideon.h expose an initial stable extern "C" ABI for creating/freeing tensors and running add, matmul, and relu. Expanding the C API will make Oxideon straightforward to embed in C, C++, Swift, Go, and Zig applications.

Proposed Additions

  • Tensor ops: oxideon_tensor_conv2d, oxideon_tensor_softmax, oxideon_tensor_layer_norm, oxideon_tensor_gelu, oxideon_tensor_silu, oxideon_tensor_reshape, oxideon_tensor_transpose.
  • Weight I/O: oxideon_safetensors_load / oxideon_safetensors_get (backed by SafetensorsMmap).
  • Device selection: oxideon_tensor_to_cuda(t, device_idx) / oxideon_cuda_is_available().
  • Add a minimal examples/c_embed/ project with a CMakeLists.txt showing how to link oxideon from C/C++.

Relevant Files

  • crates/oxideon-core/src/c_api.rs
  • include/oxideon.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions