synchronization - CUDA: Particle method, ID assignment to newly created particles in the Threads -


i have problem in project. in particle method , particles have own properties id velocity pressure etc. calculation done in gpu, 1 thread per particle. when particle splits, 3. new particles need id problem multiple splitted particles multiple threads try assign same particle id. did using __syncthreads() slow. there other way achieve that?

the use of synchronization id generation not seem justified in case.

you can try assign id based on id of parent particle. example, include parent's particle id in child's id. so, child id ..

to_int(string(parent_id) + string(child_no)) 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -