mitsuba-renderer / enoki

Enoki: structured vectorization and differentiation on modern processor architectures
Other
1.26k stars 94 forks source link

Error: zero size memory allocation when calling 'cuda_partition' #126

Closed hyeonjang closed 2 years ago

hyeonjang commented 2 years ago

Hello, I am a big fan of this lib.

During using CUDAArray, I encounter the error to allocate the memory with size zero. With debugging, I found that It occurs from calling the function "cuda_partition"

https://github.com/mitsuba-renderer/enoki/blob/2a18afa2402e0677887c8439fa3d6a270ea15726/src/cuda/horiz.cu#L81-L103

I think the line 99 should be changed as like the line 86. cuda_check(cudaMemcpyAsync(counts_h, counts, (num_runs_h+1) * sizeof(uint32_t), cudaMemcpyDeviceToHost));

Or it will be fixed on the next version release?

Speierers commented 2 years ago

This will be fixed in the upcoming release and therefore we won't take the time to fix it in the current codebase.