220 25845 <CALnjya8DWi2pdiFDJOoF3G4mF7UzOW8NbA=N8zc5OCdqt6NxQw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Mathias Gaunard <mathias@gaunard.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Fixed-size views and spans
Date: Sun, 8 May 2016 11:16:12 +0100
Lines: 97
Approved: news@gmane.org
Message-ID: <CALnjya8DWi2pdiFDJOoF3G4mF7UzOW8NbA=N8zc5OCdqt6NxQw@mail.gmail.com>
References: <09bfdbe7-70d9-4d25-9f51-4b79cecfb79f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1133b5503aa07b053251fb21
X-Trace: ger.gmane.org 1462703057 17952 80.91.229.3 (8 May 2016 10:24:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 8 May 2016 10:24:17 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDCN3ZE6W4GRBPVHXS4QKGQE62YTV2I@isocpp.org Sun May 08 12:24:00 2016
Return-path: <std-proposals+bncBDCN3ZE6W4GRBPVHXS4QKGQE62YTV2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f72.google.com ([74.125.82.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDCN3ZE6W4GRBPVHXS4QKGQE62YTV2I@isocpp.org>)
	id 1azLsW-0000jZ-1d
	for gclcip-std-proposals@m.gmane.org; Sun, 08 May 2016 12:24:00 +0200
Original-Received: by mail-wm0-f72.google.com with SMTP id e201sf76414308wme.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 08 May 2016 03:23:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=IZWaJEU493JYDLKE0Umx9ZcScY2tBZysl8zMcPRP+ko=;
        b=KzS//q63ENVDcsg+tJSneXfhAWXVYIr+hL3aZmUUVXSF6y6EuFoJy/ZBLH5q/dNuju
         +axwZbTGKdCRyJTN/uDB2KF8OCZagnVY1QfftLI2l3Dzr9mV7BvSpjaafAzTlwXBOvER
         DXxhzUe8dZriGZAMkpHvgyiwjkno+D9h5cODfPhB4Pt30E1ZHSe0vHR+L0uWAWmZa8Xx
         3LoI4G6gOuO9N4NZr8FpmTWo9OWyqFpfmz/J11+asC4jAIaebut8zJCC1Td9iVCl2BbQ
         wmG5e0sxg8witTWJp/kMTz5e62cRH8hpI8ymv0jlO1kBgM9JXcpZ8mRn7k+1W6tq997r
         hnAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=IZWaJEU493JYDLKE0Umx9ZcScY2tBZysl8zMcPRP+ko=;
        b=YiQvASG8JjhduXImaBwSH5uvp0DWiQfTq3a1gvKvNLWGWyfZB65Hs3rHDzapCdfp3V
         WkcEyQJxrqrGOLHC0QAwm0MUJpYuUsTODUVnXG8mWu9J658nXaEjmtkzaisJBNgMcN9A
         ER0qochvrRhfCgAvtUyKmyLWU0sQa5g9zO5qoSoRav53q3SRgLkEJqu8DDwWezXO/bdh
         KkPob+AEu/+j4Y4B1C38DYuEYLgBnC8shE2IKv0Y3lH4Hd18Pnwn8NzLfpPpEnvq6mM5
         /r4IVxVd0GO/aUqQvzbdN0dDUsjINvuIyJV8/6nbqvex+UILoJCUZef6OqyTAlSYLfll
         8o+w==
X-Gm-Message-State: AOPr4FWCC4TeNQY4d3FySU174vgtq1RAJj4yhw8ktnt0iZXwzco61QefmyY3mZg2bVKEcQ==
X-Received: by 10.28.184.199 with SMTP id i190mr503079wmf.6.1462703039168;
        Sun, 08 May 2016 03:23:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.152.213 with SMTP id a204ls459584wme.27.gmail; Sun, 08 May
 2016 03:23:58 -0700 (PDT)
X-Received: by 10.28.10.196 with SMTP id 187mr6046941wmk.76.1462703038183;
        Sun, 08 May 2016 03:23:58 -0700 (PDT)
Original-Received: from 7.mo2.mail-out.ovh.net (7.mo2.mail-out.ovh.net. [188.165.48.182])
        by mx.google.com with ESMTPS id lc6si27971691wjc.172.2016.05.08.03.23.58
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 08 May 2016 03:23:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of mathias@gaunard.com designates 188.165.48.182 as permitted sender) client-ip=188.165.48.182;
Original-Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59])
	by mo2.mail-out.ovh.net (Postfix) with ESMTP id D6258FFC114
	for <std-proposals@isocpp.org>; Sun,  8 May 2016 12:16:12 +0200 (CEST)
Original-Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42])
	(Authenticated sender: mathias@gaunard.com)
	by player169.ha.ovh.net (Postfix) with ESMTPSA id B3FE1580086
	for <std-proposals@isocpp.org>; Sun,  8 May 2016 12:16:12 +0200 (CEST)
Original-Received: by mail-lf0-f42.google.com with SMTP id j8so172448411lfd.2
        for <std-proposals@isocpp.org>; Sun, 08 May 2016 03:16:12 -0700 (PDT)
X-Received: by 10.112.30.174 with SMTP id t14mr5261790lbh.128.1462702572213;
 Sun, 08 May 2016 03:16:12 -0700 (PDT)
Original-Received: by 10.25.25.85 with HTTP; Sun, 8 May 2016 03:16:12 -0700 (PDT)
In-Reply-To: <09bfdbe7-70d9-4d25-9f51-4b79cecfb79f@isocpp.org>
X-Gmail-Original-Message-ID: <CALnjya8DWi2pdiFDJOoF3G4mF7UzOW8NbA=N8zc5OCdqt6NxQw@mail.gmail.com>
X-Ovh-Tracer-Id: 1291407197378950783
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekledruddtgddvhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu
X-Original-Sender: mathias@gaunard.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of mathias@gaunard.com designates 188.165.48.182 as permitted sender) smtp.mailfrom=mathias@gaunard.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:25845
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25845>

--001a1133b5503aa07b053251fb21
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 8 May 2016 at 10:44, Morwenn <morwenn29@gmail.com> wrote:

> Another quick idea: sometimes we know that we will perform an operation o=
n
> the next N element of an iterable, where N is known at compile-time. It
> might be the case for what we could call =C2=AB bottom-up divide-and-conq=
uer =C2=BB
> algorithms. For example, WikiSort
> <https://github.com/BonzaiThePenguin/WikiSort> starts by dividing the
> collection to sort in chunks of 8 elements and sorting them before
> proceeding with soe smart merging operations. We know how to speed up som=
e
> operations when the number of elements is small and known at compile-time=
:
> sorting networks are an excellent tool to sort integers when the size of
> the collection to sort is known at compile-time.
>
> However there is no simple way to tell to the standard library's
> algorithms that they will work with a small number of elements known at
> compile-time. A solution would be to add span and view classes that take =
an
> integer template parameter for their size, and let library implementers a=
dd
> overloads to algorithms for such utility classes when they think it is
> useful (it could still fit the Ranges TS design).
>
> Any thoughts about the usefulness of such fixed-size span and view classe=
s?
>

You can have a merge sort algorithm for arbitrary sizes be defined in terms
of a kernel to sort 8 elements built with a sorting network.
I already plan to provide that as part of the SIMD algorithms.

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CALnjya8DWi2pdiFDJOoF3G4mF7UzOW8NbA%3DN8zc5OCdqt=
6NxQw%40mail.gmail.com.

--001a1133b5503aa07b053251fb21
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 8=
 May 2016 at 10:44, Morwenn <span dir=3D"ltr">&lt;<a href=3D"mailto:morwenn=
29@gmail.com" target=3D"_blank">morwenn29@gmail.com</a>&gt;</span> wrote:<b=
r><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"ltr">Another quick idea: sometimes we know t=
hat we will perform an operation on the next N element of an iterable, wher=
e N is known at compile-time. It might be the case for what we could call =
=C2=AB bottom-up divide-and-conquer =C2=BB algorithms. For example, <a href=
=3D"https://github.com/BonzaiThePenguin/WikiSort" target=3D"_blank">WikiSor=
t</a> starts by dividing the collection to sort in chunks of 8 elements and=
 sorting them before proceeding with soe smart merging operations. We know =
how to speed up some operations when the number of elements is small and kn=
own at compile-time: sorting networks are an excellent tool to sort integer=
s when the size of the collection to sort is known at compile-time.<br><br>=
However there is no simple way to tell to the standard library&#39;s algori=
thms that they will work with a small number of elements known at compile-t=
ime. A solution would be to add span and view classes that take an integer =
template parameter for their size, and let library implementers add overloa=
ds to algorithms for such utility classes when they think it is useful (it =
could still fit the Ranges TS design).<br><br>Any thoughts about the useful=
ness of such fixed-size span and view classes?</div></blockquote><div><br><=
/div>You can have a merge sort algorithm for arbitrary sizes be defined in =
terms of a kernel to sort 8 elements built with a sorting network.<div>I al=
ready plan to provide that as part of the SIMD algorithms.=C2=A0</div></div=
></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALnjya8DWi2pdiFDJOoF3G4mF7UzOW8NbA%3=
DN8zc5OCdqt6NxQw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALnjya8DWi2pdi=
FDJOoF3G4mF7UzOW8NbA%3DN8zc5OCdqt6NxQw%40mail.gmail.com</a>.<br />

--001a1133b5503aa07b053251fb21--

.
