What problem does it solve?
Writing correct GPU compute code with LuisaCompute requires knowing the exact runtime API surface—Context, Device, Stream, Buffer, Image, ray tracing, and rasterization classes—plus subtle build-mode constraints like SAFE-mode buffer transfer rules. This Skill provides the correct API patterns and code examples so you avoid compile errors and misuse.
Core Features & Use Cases
- Device and Resource Management: Create contexts, devices (CUDA, DX, CPU, Metal), buffers, images, volumes, bindless arrays, and swapchains with correct call signatures.
- Execution and Synchronization: Submit kernels via streams, batch commands with CommandList, and coordinate multi-stream work with events and timeline events.
- Ray Tracing and Rasterization: Build meshes, curves, and acceleration structures, write intersection kernels, and set up raster scenes with depth buffers.
- SAFE-Mode Compatibility: Learn which buffer copy overloads are excluded under LUISA_ENABLE_SAFE_MODE and how to use BufferView and luisa::span alternatives.
- Use Case: You are writing a CUDA path tracer with LuisaCompute and need to create an Accel, dispatch an intersection kernel, and read back results without triggering SAFE-mode compile errors.
Quick Start
Ask the assistant to write a LuisaCompute program that creates a CUDA device, fills a float buffer with a kernel, and copies the results back to the host in SAFE-mode-compatible style.