25 points · by darkxanthos · 15y ago · 11 comments
- the size of the grid is fixed at kernel launch time, so you can't arbitrarily spawn more work
- the completion of one block cannot depend on the execution of another block, which means inter-block communication within a kernel is forbidden
So you could do some sort of block-local actor operation then do an exchange of the halo cells between blocks in another kernel (the only global synchronization point allowed in CUDA/OpenCL), but that seems really painful, especially if actors are sparse within your grid. A work queue approach would probably work better; you'd certainly get better utilization and load balancing than trying to spatially partition a large grid.
It is necessary to initialize all variables. This will cause a run time error.
This probably should read: 'accessing uninitialized variables causes a runtime error'.
It is necessary to check your memory indexes for all data structures, if they are wrong you will have run time errors.
What would be a 'memory index'? An index into an array? Yes indeed, an out-of-bounds array index will cause an error sooner or later. If your language doesn't check array bounds, like C, the bugs will be subtle and insidious.