소스 정보
- 저장소
- LuisaGroup/LuisaCompute
- 최근 소스 활동
- 2026년 6월 13일 15:22
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1,038
- 포크
- 108
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/LuisaGroup/LuisaCompute --skill project-structure명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | project_structure |
| description | Project layout, module architecture, compiler pipeline, and design patterns. |
Layered architecture: Core → AST/IR → DSL/Runtime → Backends. src/ + public headers include/luisa/. Dual build: CMake + XMake. Frontends: C++, Python, Rust.
src/
├── api/ C API & runtime API layer
├── ast/ AST (expressions, statements, types, function builder)
├── backends/ Plugins: CUDA, DX, Metal, CPU, Vulkan, HIP, remote, fallback, common
├── clangcxx/ Clang-based C++→GPU shader compiler (experimental)
├── core/ Foundation: types, math, logging, platform, STL wrappers
├── dsl/ Embedded C++ DSL (kernel/callable lambda tracing)
├── ext/ Third-party deps (git submodules)
├── gui/ Windowing, ImGui, framerate
├── ir/ IR bridge: AST↔IR transforms
├── osl/ Open Shading Language parser
├── py/ Python bindings (pybind11 + pure Python)
├── runtime/ Unified runtime: device, buffer, image, stream, RTX, raster
├── rust/ Rust workspace: IR, CPU backend, remote
├── tensor/ Tensor ops & compute graph
├── tests/ Unit/integration/example tests
├── vstl/ Virtual STL: custom containers, allocators, hashes
└── xir/ Extended IR: SSA, basic blocks, passes, translators
include/luisa/ Public headers mirroring src/ layout (+ ir_v2/)
Root also has: examples/, tests/, tutorials/, utils/, docs/
src/core/ — FoundationPlatform abstractions, math, logging, binary I/O, dynamic modules.
basic_types.cpp — vector/matrix instantiationslogging.cpp — spdlog-based loggingplatform.cpp — OS abstraction (paths, threads, DLL)dynamic_module.cpp — cross-platform shared library loaderbinary_io.cpp, binary_file_stream.cpp — binary serializationfirst_fit.cpp, pool.cpp, string_scratch.cpp — allocators/scratch buffersstl/ — custom STL: vector, string, unordered_map, optional, variant, etc.generate_swizzles.py — swizzle codegensrc/vstl/ — Virtual STLHigh-perf containers beyond core/stl: stack_allocator, string_builder, lmdb, md5, v_guid. Headers: include/luisa/vstl/* (hash maps, arenas, lockfree queues, ranges).
src/ast/ — Abstract Syntax TreeDSL traces C++ lambdas → AST nodes.
expression.cpp — literal, binary, unary, call, swizzle, memberstatement.cpp — if, loop, switch, break, return, ray_querytype.cpp — scalars, vectors, matrices, buffers, textures, structsfunction.cpp — kernel/callable metadatafunction_builder.cpp — manual AST construction APIvariable.cpp — local variablesop.cpp — BinaryOp, UnaryOp, CallOpast2json.cpp — AST→JSON serializationconstant_data.cpp, callable_library.cpp, external_function.cpp, function_duplicator.cpp, atomic_ref_node.cppsrc/xir/ — Extended IR (Next-Gen)SSA IR with basic blocks, instructions, optimization passes. Receives AST via ast2xir.
instructions/ — 30+ types: arithmetic, memory, control flow, resource, autodiff, atomicpasses/ — DCE, mem2reg, SROA, autodiff, outline, dom-tree, GEP tracing, local load/store elimination, ray-query lowering, unused callable removal, LICM, GVN, SCCP, inlining, CFG simplificationtranslators/ — ast2xir, xir2json, json2xir, xir2text, xir2astmetadata/ — source locations, names, comments, curve basistests/ — XIR unit tests (enabled by LUISA_COMPUTE_ENABLE_XIR_TESTS)Module, Function, BasicBlock, Instruction, Value, Use, Buildersrc/ir/ — IR Bridge (Legacy)AST↔IR transforms, high-level transforms: ast2ir.cpp, ir2ast.cpp, transform.cpp.
src/dsl/ — Embedded DSLGPU kernels via lambda tracing.
func.cpp — Kernel1D/2D/3D, Callablebuiltin.cpp — dispatch_id, thread_id, mathresource.cpp — buffer/image/volume/bindless DSL wrapperslocal.cpp — local/thread storage helperssugar.cpp — $if, $for, $whilertx/ — ray tracing: Accel, Ray, RayQuery, Curve, TriangleHitraster/ — RasterKernelext/ — DSL extensionssoa.cpp, polymorphic.cpp, dispatch_indirect.cppsrc/runtime/ — Unified RuntimeResource management, command scheduling, RHI abstraction.
device.cpp, context.cpp — device creation, backend loadingstream.cpp, command_list.cpp — command batching/submissionbuffer.cpp, image.cpp, volume.cpp — GPU memorybyte_buffer.cpp, dispatch_buffer.cpp, mipmap.cpp — auxiliary bufferssparse_buffer.cpp, sparse_texture.cpp, sparse_heap.cpp, sparse_command_list.cpp — sparse resourcesbindless_array.cpp, swapchain.cpp, event.cpp, builtin_kernel.cpprhi/ — device_interface.h, command.h, command_encoder.h, resource.hrtx/ — accel.cpp, mesh.cpp, curve.cpp, motion_instance.cpp, procedural_primitive.cppraster/ — raster.cpp, depth_buffer.cppremote/ — remote device client/serversrc/backends/ — Backend PluginsDynamically loaded (luisa-backend-<name>.dll/.so). Each: codegen (AST/XIR→native) + compiler (NVRTC/DXC/etc.) + resources + command encoder.
| Backend | Technology |
|---|---|
CUDA (cuda/) | NVRTC + OptiX + CUDA driver |
DirectX (dx/) | DX12 + DXR + HLSL DXC |
Metal (metal/) | Metal 3 + MSL |
CPU (cpu/) | Rust-based (via src/rust/) |
Vulkan (vk/) | Vulkan + SPIR-V |
HIP (hip/) | AMD HIP |
Remote (remote/) | Network-distributed |
Fallback (fallback/) | Reference interpreter |
Common (common/) | c_codegen/, hlsl/, spirv/, spirv_llvm/, Vulkan swapchain helpers |
Validation (validation/) | Debug layer |
Toy C (toy_c/) | Minimal C codegen |
src/rust/ — Rust Workspaceluisa_compute_ir — core IR: AST→IR, analysis, transforms (DCE, inliner, SSA, autodiff, vectorize)luisa_compute_ir_v2 — IR v2 bindingsluisa_compute_ir_staticlib — static library wrapper for C++ linkingluisa_compute_backend — backend proxy/message protocolluisa_compute_backend_impl — CPU backend: LLVM JIT, C++ codegen, texture sampling, remote backendluisa_compute_cpu_kernel_defs — CPU kernel ABI definitionsluisa_compute_api_types — C API typessrc/api/ — C APIStable C API for language bindings: runtime.cpp, logging.cpp, Rust binding/RPC generators.
src/py/ — Pythonlcapi.cpp — pybind11 entry; export_*.cpp — per-component bindingsluisa/ — pure Python package: buffer.py, accel.py, autodiff.py, gui.py, types.pyinterop.cpp/h — PyTorch/DLPacksrc/tensor/ — Tensor & Compute GraphHigh-level tensor ops, expression DAG, graph passes.
fallback/ — CPU kernels (matmul, softmax)pass/ — graph passessrc/clangcxx/, src/osl/, src/gui/, src/ext/src/tests/unit/{core,ast,dsl,runtime,ext,xir}/ — unit tests by layerintegration/{runtime,ir}/ — cross-cutting integration testscommon/ — shared headers (test_device.h, ut/, asset loaders)cxx_shaders/ — C++ shader testspython/ — Python frontend testsut/ — extra UT harness directorytest_path_tracing, test_dsl, test_rtx, test_raster, test_tensor, test_autodiff, etc.)src/CMakeLists.txt, targets: luisa-compute-<name>, alias: luisa::compute. Backends as MODULE plugins named luisa-backend-<name>. Options: LUISA_COMPUTE_ENABLE_CUDA|DX|METAL|CPU|VULKAN|HIP|DSL|RUST|TENSOR|GUI|...xmake.lua in root + src/ and subdirsbootstrap.py at repo rootupdate_intellisense.luaDSL Tracing (src/dsl/) → AST (src/ast/)
│
┌─────────┴─────────┐
▼ ▼
XIR (src/xir/) IR (src/ir/ → src/rust/)
│ │
└─────────┬─────────┘
▼
Backend Codegen (src/backends/<name>/)
│
▼
GPU Execution (src/runtime/)
Rust IR path: luisa_compute_ir does autodiff, DCE, SSA, vectorize before codegen.
| Header | Scope |
|---|---|
<luisa/luisa-compute.h> | Core + AST + DSL + Runtime + GUI |
<luisa/dsl/syntax.h> | DSL core |
<luisa/dsl/sugar.h> | Sugar macros |
<luisa/runtime/context.h> | Runtime entry |
<luisa/runtime/device.h> | Device & resources |
src/runtime/rhi/ abstracts GPU APIs into common interfacesBuffer, Image, Stream, Accel)Command → CommandList → Stream| Convention | Example |
|---|---|
| CMake target | luisa-compute-core |
| Backend binary | luisa-backend-cuda |
| PCH | lc_core_pch.h |
| Integration test | test_path_tracing.cpp |
| Python export | export_runtime.cpp |
src/backends/<name>/, implement DeviceInterface, register in src/backends/CMakeLists.txtsrc/xir/passes/, register in src/xir/CMakeLists.txtrhi/resource.h, implement per-backend, expose in runtime/ + include/luisa/runtime/tensor/ is opt-in, less mature. clangcxx/ is experimental.