[libcxx-commits] [PATCH] D120186: [pstl] Implementation of Grand Central Dispatch backend

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 1 06:51:38 PDT 2022


philnik added inline comments.


================
Comment at: pstl/include/pstl/internal/gcd/parallel_invoke.h:29
+    dispatch_apply_f(2, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), &__data,
+                     [](void* __ctx, ::std::size_t __index)
+                     {
----------------
Is there a reason you use `::std` here instead of `std`?


================
Comment at: pstl/include/pstl/internal/gcd/parallel_stable_partial_sort.h:29
+    // TODO: The partial sort implementation should be shared with the other backends.
+    __leaf_sort(__xs, __xe, __comp);
+}
----------------
This isn't ADL-proof.


================
Comment at: pstl/include/pstl/internal/gcd/util.h:104
+        // is safe to pass a pointer to the stack allocated data above.
+        dispatch_apply_f(__n_chunks_, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), this,
+                         [](void* __ctx, std::size_t __chunk)
----------------
Also not ADL-proof


================
Comment at: pstl/include/pstl/internal/parallel_backend_gcd.h:14-16
+//------------------------------------------------------------------------
+// parallel_invoke
+//------------------------------------------------------------------------
----------------
These comments seem weird to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120186/new/

https://reviews.llvm.org/D120186



More information about the libcxx-commits mailing list