LuisaGroup/LuisaCompute

High-Performance Rendering Framework on Stream Architectures

What it solves

LuisaCompute is a high-performance, cross-platform computing framework designed to bridge the gap between unification, programmability, and performance. It allows developers to write computation kernels once and run them across various hardware backends (CUDA, DirectX, Metal, and CPU) without having to write platform-specific shader code for each.

How it works

The framework consists of three primary components:

  • Embedded Domain-Specific Language (DSL): It uses a DSL embedded in modern C++ that allows users to author kernels using C++ syntax. It employs meta-programming and operator overloading to trace kernels into Abstract Syntax Trees (ASTs), which are then JIT-compiled into platform-dependent shader source code.
  • Unified Runtime: An abstract runtime layer acts as a bridge between high-level frontend interfaces and low-level backend APIs. It provides resource wrappers (statically typed C++ objects) to manage memory and schedule commands, automatically probing dependencies to optimize hardware utilization.
  • Multiple Backends: Specialized backends translate ASTs and intermediate commands into native kernel launches for CUDA, Metal, DirectX, and a Rust-implemented CPU fallback.

Who it’s for

It is primarily for developers building high-performance graphics applications, rendering engines, or general-purpose stream-processing software who need cross-platform compatibility without sacrificing performance.

Highlights

  • Unified Authoring: Host-side logic and device-side kernels are both written in modern C++.
  • Cross-Platform Support: Native backends for CUDA, DirectX, Metal, and CPU.
  • Python Frontend: Offers a Python interface for easier access to the framework's capabilities.
  • Automatic Differentiation: Supports automatic differentiation for computation tasks.
  • Resource Management: High-level wrappers eliminate boilerplate code for resource handling and command submission.

Related

  • Project
  • Project
  • Project
  • Project
  • Project