How can I sync within partial threads in a block?

For example I have 128 threads in a block, now I want 0-63 threads to sync and 64-127 threads to sync. How can I do that? (these two groups are actually doing different work)

I know I can use warp sync to manually do it…But I guess cooperative group can directly do it, right?

Yes, just make a group of 64 threads and use group.sync().