mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
593 stars 43 forks source link

Make `__dlpack__` and `__dlpack_device__` constistent #263

Closed njroussel closed 2 months ago

njroussel commented 2 months ago

Fixes https://github.com/mitsuba-renderer/mitsuba3/issues/1229

Currently, __dlpack__ and __dlpack_device__ are potentially inconsistent. This fix favors jit_cuda_device_raw over jit_var_device, because the latter will throw an error for JIT variables that point to memory regions allocated by other frameworks (jit_var_mem_map).