NanoVDB: optional CCCL cuda::mr / cuda::buffer adapter

Aperta
#2,419 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

This is design work, not a ready task, and the issue says it is not planned until someone asks for it. Start with the custom allocator pattern in cuda/DeviceResource.h and the MINIMUM_CCCL_VERSION constraint in the build configuration. Done would mean an agreed design, a use case from a maintainer, and a version-gated adapter that maps the CCCL allocate_sync and allocate calls onto NanoVDB's resource interface.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

nanovdb

Split out of #2232, where it was step 4. Not planned until someone needs it. If you do, please comment here with your use case.

What it would be

Optional interop between NanoVDB's CUDA memory types and CCCL's:

  • Use a CCCL cuda::mr resource (or resource_ref) wherever NanoVDB takes a ResourceT.
  • Use a CCCL cuda::buffer<std::byte> as GridHandle storage.
  • Convert cuda::Buffer<T> and cuda::BufferView<T> to and from cuda::std::span<T>.
Why it waits
  • NanoVDB can't depend on recent CCCL. It supports CCCL back to 2.8 (MINIMUM_CCCL_VERSION), but cuda::buffer only exists in the CCCL that ships with CUDA 13.2 and later. An adapter would have to be version-gated. It would sit next to NanoVDB's own cuda::Buffer and resources rather than replace them, and replacing them has to wait until the minimum CCCL version catches up.
  • CCCL's resource interface has moved since #2232 was written. In CCCL 3.4.2, the version NanoVDB fetches by default, synchronous allocation is allocate_sync(bytes, alignment) / deallocate_sync(ptr, bytes, alignment), and stream-ordered allocation is allocate(stream, bytes, alignment) / deallocate(stream, ptr, bytes, alignment), with the stream first. NanoVDB's resources use the earlier spellings: allocate(bytes, alignment) and allocate_async(bytes, alignment, stream). So the adapter is a real wrapper that maps one interface onto the other, not a type alias. The same applies to #2232's planned using Buffer = ::cuda::buffer<T> alias at CUDA 13.2 or later.
  • It isn't needed to inject an allocator. Today a custom allocator is a small NanoVDB resource struct (see cuda/DeviceResource.h), and wrapping a CCCL resource in one is a few lines of forwarding.
When to revisit
  • Someone asks for native CCCL interop, or
  • the minimum CCCL version reaches one with cuda::buffer and the current cuda::mr spelling, at which point NanoVDB could adopt the CCCL spelling outright instead of adding an adapter.
Lingua principale
C++
Stelle
3.6k
Fork
807
Merge medio
6g 4h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AcademySoftwareFoundation/openvdb

Tutte le issue di AcademySoftwareFoundation/openvdb

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.