Re: [GSOC2020][Boost.uBLAS] C++20-ification of uBLAS
Ashar via ublas <[email protected]> Thu, 19 Mar 2020 23:04:52 +0530
| Newsgroups | gmane.comp.lib.boost.ublas |
|---|---|
| Message-ID | <CAD0hxu=k_Qwrsjfdy_TkNJaEAp=zXxkbtpEUTJfHBYaue51wSQ@mail.gmail.com> |
--===============6207909901757252508== Content-Type: multipart/alternative; boundary="00000000000000574505a13897ab" --00000000000000574505a13897ab Content-Type: text/plain; charset="UTF-8" > > 1. using a different branch, improve code quality using c++20 > contracts and attributes for tensor, using (expects,ensure,assert) > contra > <https://www.modernescpp.com/index.php/c-core-guidelines-a-detour-to-contracts> > > Hey Cem, Are you sure to add contracts in uBLAS. Contracts was proposed for C++17 and did not made it up to C++20 and I have no idea when it will come to but there are some implementation of contracts TS draft by some third party compiler hackers who implement things, So I will have to compile the compiler with contract support and then test it during development. I have no problems doing it, I can see all the great places it will be used. Will it be worth doing something that can't be directly used by other? In addition to the above, I was thinking of also having complete compile time tensor. c++20 has new and delete marked constexpr, so we can use std::vector container which is now compile-time and modify current to have a complete compile time tensor class. With examples and how to use it, this will be easy, if I use Amit's static extents. This is I believe an extension to the list of ideas you presented above. I still need your view on if I should go ahead with the contracts? Concepts are okay and So is constexpr thing! Also I believe eventually if I follow up your list of ideas tensor<2, rank> can be matrix and tensor<1, rank> can become a vector and in a long run it can replace the specially designed matrix and vector of ublas. (backward compatibility could be provided thought). We will have one expression template (YAP), C++17 or 20 everywhere, it will also make maintaining the library easy because currently tensor is a separate things and matrix and vector of ublas are separator thing. This will also eventually give us many performance boost that David was talking about from modern paradigms of C++. Regards Ashar > --00000000000000574505a13897ab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div dir=3D"auto"><br></div><div class=3D"gmail_quote" di= r=3D"auto"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor= der-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gm= ail_quote"><ol><li>using a different branch, improve code quality using c++= 20 contracts and attributes for tensor, using (expects,ensure,assert) <a hr= ef=3D"https://www.modernescpp.com/index.php/c-core-guidelines-a-detour-to-c= ontracts" target=3D"_blank" rel=3D"noreferrer">contra</a></li></ol></div></= div></blockquote></div><div dir=3D"auto"><div dir=3D"auto" style=3D"font-fa= mily:sans-serif">Hey Cem,</div><div dir=3D"auto" style=3D"font-family:sans-= serif"><br></div><div dir=3D"auto" style=3D"font-family:sans-serif">Are you= sure to add contracts in uBLAS. Contracts was proposed for C++17 and did n= ot made it up to C++20 and I have no idea when it will come to but there ar= e some implementation of contracts TS draft by some third party compiler ha= ckers who implement things, So I will have to compile the compiler with con= tract support and then test it during development. I have no problems doing= it, I can see all the great places it will be used.</div><div dir=3D"auto"= style=3D"font-family:sans-serif"><br></div><div dir=3D"auto" style=3D"font= -family:sans-serif">Will it be worth doing something that can't be dire= ctly used by other?</div><div dir=3D"auto" style=3D"font-family:sans-serif"= ><br></div><div dir=3D"auto" style=3D"font-family:sans-serif">In addition t= o the above, I was thinking of also having complete compile time tensor. c+= +20 has new and delete marked constexpr, so we can use std::vector containe= r which is now compile-time and modify current to have a complete compile t= ime tensor class. With examples and how to use it, this will be easy, if I = use Amit's static extents. This is I believe an extension to the list o= f ideas you presented above.</div><div dir=3D"auto" style=3D"font-family:sa= ns-serif"><br></div><div dir=3D"auto" style=3D"font-family:sans-serif">I st= ill need your view on if I should go ahead with the contracts? Concepts are= okay and So is constexpr thing! Also I believe eventually if I follow up y= our list of ideas tensor<2, rank> can be matrix and tensor<1, rank= > can become a vector and in a long run it can replace the specially des= igned matrix and vector of ublas. (backward compatibility could be provided= thought). We will have one expression template (YAP), C++17 or 20 everywhe= re, it will also make maintaining the library easy because currently tensor= is a separate things and matrix and vector of ublas are separator thing.= =C2=A0</div><div dir=3D"auto" style=3D"font-family:sans-serif"><br></div><d= iv dir=3D"auto" style=3D"font-family:sans-serif">This will also eventually = give us many performance boost that David was talking about from modern par= adigms of C++.</div><div dir=3D"auto" style=3D"font-family:sans-serif"><br>= </div><div dir=3D"auto" style=3D"font-family:sans-serif">Regards</div><div = dir=3D"auto" style=3D"font-family:sans-serif">Ashar</div></div><div class= =3D"gmail_quote" dir=3D"auto"><blockquote class=3D"gmail_quote" style=3D"ma= rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div></div> --00000000000000574505a13897ab-- --===============6207909901757252508== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline