on-internet
← Community

Non Atomic Parallel Reduction with Metal

Stack Overflow ·

I'm just getting into the world of parallel reductions. I'm trying to implement this with Metal. I have been able to successfully write a simple version using atomic types and using the atomic_fetch_* functions. I am now trying trying to do something similar with non-atomic variables, a simple struct. Defined like this: struct Point2 { int x; int y; }; With a kernel function like this: kernel void compareX(const device Point2 *array [[ buffer(0) ]], device Point2 *result [[ buffer(1) ]], uint id [[ thread_position_in_grid ]], uint tid [[ thread_index_in_threadgroup ]], uint bid [[ threadgroup_

Comments

Sign in or sign up to comment and upvote.

No comments yet.