From patchwork Tue Oct 1 21:01:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1170234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510014-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="asxr401D"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jWtF5vxyz9sDB for ; Wed, 2 Oct 2019 07:02:13 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=JmCTaZVyVzG/u0CveCvKwieqdpuFA0 ebEIRIDDYoa3LXDz/ErUnYeZksiMvCPQK45quz/TaZ2jMDzL3sxjQDUEqm9OxPw8 FO+Qn2RnLPf3fw4iu0dL6nJ3NVjQnZePF6+fpQ1emFBAAMIfr2Mfgn0iJyaUNaVN are2LY2e1eCRc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=//QnNKMBgKNkj4bi3Mk+U7oBk7w=; b=asxr 401D2i4HsTf85nYOcp2Qf9+k3KBZTFbT/ukViMQ9M3Uz54W/RTrTFyMmzaaMsqem TTAbT1oGVDEbsAyktCtx4dGBJLvDJkSz5eIevse5HLy1cVkr/o0vTYxrmhX+gGlx FClKCc6xEiAPO9VUY0FF1Z8FcxbLEWUSMpG/v+A= Received: (qmail 51628 invoked by alias); 1 Oct 2019 21:01:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 51599 invoked by uid 89); 1 Oct 2019 21:01:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=Qualify X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Oct 2019 21:01:58 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B3D68980F5; Tue, 1 Oct 2019 21:01:57 +0000 (UTC) Received: from localhost (unknown [10.33.36.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE15B60BE0; Tue, 1 Oct 2019 21:01:56 +0000 (UTC) Date: Tue, 1 Oct 2019 22:01:55 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Make some new algorithms work in parallel mode Message-ID: <20191001210155.GQ9487@redhat.com> References: <20191001205849.GA12096@redhat.com> <20191001205950.GO9487@redhat.com> <20191001210111.GP9487@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191001210111.GP9487@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.0 (2019-05-25) Tested x86_64-linux (normal and parallel modes), committed to trunk. commit 92d5df45f3e62d31bebcdea9c1568b0877d0fe0e Author: Jonathan Wakely Date: Tue Oct 1 20:34:22 2019 +0100 Make some new algorithms work in parallel mode * include/experimental/algorithm (experimental::sample): Qualify call to __sample correctly. * include/parallel/algo.h (sample, for_each_n): Add using-declarations for algorithms that don't have parallel implementations. diff --git a/libstdc++-v3/include/experimental/algorithm b/libstdc++-v3/include/experimental/algorithm index 8ba212c5132..f036a713ef3 100644 --- a/libstdc++-v3/include/experimental/algorithm +++ b/libstdc++-v3/include/experimental/algorithm @@ -77,9 +77,9 @@ inline namespace fundamentals_v2 "sample size must be an integer type"); typename iterator_traits<_PopulationIterator>::difference_type __d = __n; - return std::__sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, - __d, - std::forward<_UniformRandomNumberGenerator>(__g)); + return _GLIBCXX_STD_A:: + __sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, __d, + std::forward<_UniformRandomNumberGenerator>(__g)); } template= 201703L + using _GLIBCXX_STD_A::for_each_n; + using _GLIBCXX_STD_A::sample; +#endif } // end namespace } // end namespace