This is an archive of the discontinued LLVM Phabricator instance.

[libc++][PSTL] Implement std::count{,_if}
ClosedPublic

Authored by philnik on May 8 2023, 10:24 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG7a3b528e1b54: [libc++][PSTL] Implement std::count{,_if}

Diff Detail

Event Timeline

philnik created this revision.May 8 2023, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 10:24 AM
philnik requested review of this revision.May 8 2023, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 10:24 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik updated this revision to Diff 522301.May 15 2023, 12:36 PM

Use new dispatching approach

philnik updated this revision to Diff 522641.May 16 2023, 8:30 AM

Try to fix CI

ldionne requested changes to this revision.May 16 2023, 12:34 PM
ldionne added inline comments.
libcxx/include/__algorithm/pstl_count.h
1

We should update the backend documentation comment.

44

I think we should implement this using reduce instead, like in the original PSTL. I think we should implement std::reduce before we implement this one.

libcxx/test/std/algorithms/alg.nonmodifying/alg.count/pstl.count.pass.cpp
55

Can you also test a 3 element range with {yes, no, yes}? Right now, the tests would pass if we were counting the number of consecutive elements equal to the value, kind of like equal_range I guess.

libcxx/test/std/algorithms/alg.nonmodifying/alg.count/pstl.count_if.pass.cpp
55

Same for {yes no yes}.

This revision now requires changes to proceed.May 16 2023, 12:34 PM
philnik updated this revision to Diff 523222.May 17 2023, 5:06 PM
philnik marked 4 inline comments as done.

Address comments

philnik updated this revision to Diff 527100.May 31 2023, 9:58 AM

Try to fix CI

ldionne accepted this revision.Jun 5 2023, 8:36 AM
This revision is now accepted and ready to land.Jun 5 2023, 8:36 AM
philnik updated this revision to Diff 528485.Jun 5 2023, 9:56 AM

Try to fix CI

philnik updated this revision to Diff 528597.Jun 5 2023, 3:15 PM
  • Rebase
  • Try to fix CI
This revision was automatically updated to reflect the committed changes.