How gpuopen-librariesandsdks/hiprt works
HIPRT is a low-level ray-tracing library for HIP applications. The principal workflow is an application using the HIPRT API to create a context and build acceleration structures, then invoking device-side traversal from HIP kernels. The tree also shows distinct geometry, instance, batch-building, and BVH-import subsystems. The README documents basic, advanced, and performance-oriented use, but the sampled implementation excerpts do not expose runtime calls between these components; dashed links mark those relationships as unverified rather than inspected.
Main entry points: impl BVH builders · Context.cpp Context management · hiprt.cpp Public API · Kernel.cpp Kernel dispatch
Components 19
API and runtime
- Public API
hiprt/impl/hiprt.cpp - Context management
hiprt/impl/Context.cpp - Kernel compiler
hiprt/impl/Compiler.cpp - Kernel dispatch
hiprt/impl/Kernel.cpp - Errors and logging
hiprt/impl/Error.cpp
Acceleration building
- BVH builders
hiprt/impl - LBVH builder
hiprt/impl/LbvhBuilder.cpp - PLOC builder
hiprt/impl/PlocBuilder.cpp - SBVH builder
hiprt/impl/SbvhBuilder.cpp - Batch builder
hiprt/impl/BatchBuilder.cpp - BVH importer
hiprt/impl/BvhImporter.cpp
Scene geometry
- Triangle meshes
hiprt/impl/TriangleMesh.cpp - AABB lists
hiprt/impl/AabbList.cpp - Instance lists
hiprt/impl/InstanceList.cpp
Device traversal
- Device API
hiprt/hiprt_device.h - Device implementation
hiprt/impl/hiprt_device_impl.h
Other components
- HIP application
- HIP runtime
- Ray query result
Connections 18
- HIP application → Public API: uses API
- Public API → Context management: manages context
- Context management → Kernel compiler: configures kernels
- Context management → BVH builders: builds structures
- BVH builders → LBVH builder: selects builder
- BVH builders → PLOC builder: selects builder
- BVH builders → SBVH builder: selects builder
- Context management → Batch builder: builds batches
- Context management → BVH importer: imports BVH
- Triangle meshes → BVH builders: supplies geometry
- AABB lists → BVH builders: supplies geometry
- Instance lists → BVH builders: supplies instances
- Public API → Kernel dispatch: dispatches kernels
- HIP application → Device API: calls from kernels
- Device API → Device implementation: uses implementation
- Device implementation → Ray query result: returns hits
- Kernel dispatch → HIP runtime: uses runtime
- Public API → Errors and logging: reports failures