Commit d980ad9
NanoVDB: encode points for any resource in PointsToGrid (CUDA) (#2244)
* NanoVDB: encode points for any resource in PointsToGrid (CUDA)
The point-encode step in tools::cuda::PointsToGrid was only reachable for
the default DeviceResource, because it lived in the BuildT=Point full
specialization of processPoints (i.e. <Point, DeviceResource>). A Point
grid built with a custom resource fell through to the generic no-op and
was silently left with unencoded point data.
Fold the encode into the generic processPoints and gate it with
if constexpr(is_same<BuildT, Point>). The encode kernels run on device
data and are independent of the resource; only the trailing d_indx
deallocation routes through ResourceT. Non-Point builds and default-
resource Point builds are unchanged.
Add a regression test that builds a NanoGrid<Point> through a custom
resource and asserts every input point is recoverable from the encoded
per-voxel data.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
* NanoVDB: move the point-encode kernels out of the if-constexpr block
nvcc rejects an extended lambda defined directly inside the block of an
if constexpr statement on some host compilers, so the nine encode
launches failed to compile against MSVC while building fine with gcc and
clang. Give them their own member function and have the branch call it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 20f904e commit d980ad9
2 files changed
Lines changed: 77 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
| |||
1164 | 1171 | | |
1165 | 1172 | | |
1166 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1167 | 1177 | | |
1168 | 1178 | | |
1169 | | - | |
| 1179 | + | |
1170 | 1180 | | |
| 1181 | + | |
1171 | 1182 | | |
1172 | | - | |
| 1183 | + | |
1173 | 1184 | | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
| 1185 | + | |
1178 | 1186 | | |
1179 | | - | |
| 1187 | + | |
1180 | 1188 | | |
1181 | 1189 | | |
1182 | 1190 | | |
1183 | | - | |
| 1191 | + | |
1184 | 1192 | | |
1185 | 1193 | | |
1186 | 1194 | | |
| |||
1227 | 1235 | | |
1228 | 1236 | | |
1229 | 1237 | | |
1230 | | - | |
| 1238 | + | |
1231 | 1239 | | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
| 1240 | + | |
1236 | 1241 | | |
1237 | 1242 | | |
1238 | 1243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
212 | 271 | | |
0 commit comments