All allocation checks have been moved to memory.cpp so that nullptr comparisons aren't littering the code, and to make explicit when nested data-structures are being thoroughly checked (i.e. that all nested pointers are non-NULL, vs just the outer). Also tidied/combined validation related to memory allocation.
Structures with persistent GPU memory now have a wasGpuSynced field to indicate whether their memory has ever been copied to the GPU since creation. This replaces the previously hacky design which kept the first GPU element as a special default value until being overwritten. That design necessitated wastefully copying (a single amplitude) from device to host at every invocation of "has synched" validation, which forces kernel synchronisation and precludes efficient streaming. Further, it persuaded lots of validation boilerplate to check a user wasn't unknowingly passing in that special default value (a rare but technically possible scenario).
All allocation checks have been moved to
memory.cpp
so that nullptr comparisons aren't littering the code, and to make explicit when nested data-structures are being thoroughly checked (i.e. that all nested pointers are non-NULL, vs just the outer). Also tidied/combined validation related to memory allocation.Structures with persistent GPU memory now have a
wasGpuSynced
field to indicate whether their memory has ever been copied to the GPU since creation. This replaces the previously hacky design which kept the first GPU element as a special default value until being overwritten. That design necessitated wastefully copying (a single amplitude) from device to host at every invocation of "has synched" validation, which forces kernel synchronisation and precludes efficient streaming. Further, it persuaded lots of validation boilerplate to check a user wasn't unknowingly passing in that special default value (a rare but technically possible scenario).