Skip to content

summing data across threads #294

Discussion options

You must be logged in to vote

Well this is gonna be funny/sad...
I had chatgpt4o clean up the wording of my post before submitting it. Afterwords I thought what the hell, lets see if chatgpt can help with the actual problem. It told me to use atomic_add. It turns out I didn't read the atomic_add documentation correctly 🤦. So for my sample code you would just do

wp.atomic_add(A, i, wp.cos(theta[i]) + wp.sin(phi[j]))

I'm going to leave the post up just in case there's other dummies like me out there.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by toaster-robotics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant