From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:aed:3346:: with SMTP id u64mr25389285qtd.333.1585061745486; Tue, 24 Mar 2020 07:55:45 -0700 (PDT) X-Received: by 2002:a9d:554c:: with SMTP id h12mr22487793oti.16.1585061744986; Tue, 24 Mar 2020 07:55:44 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 24 Mar 2020 07:55:44 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c00:c1d:4b00:b460:9e11:eb4b:1809; posting-account=-iT6ZQoAAAAlqBCInAc-vB6x1soT8Jhq NNTP-Posting-Host: 2001:1c00:c1d:4b00:b460:9e11:eb4b:1809 References: <6c2c0e35-af07-4169-8be5-464ec7fd0fd5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: GNAT vs Matlab - operation on multidimensional complex matrices From: darek Injection-Date: Tue, 24 Mar 2020 14:55:45 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58238 Date: 2020-03-24T07:55:44-07:00 List-Id: Hi Jeff, Thanks for taking time to play with the code. I did an experiment. I have also on this machine Linux running in the BBOx (OpenSuse Leap 15.1 64bit). The execution time on the same hardware with the gcc version 8.3.1 20190518 (for GNAT Community 2019 20190517) (GCC) and the compiler options: -ffast-math -funroll-loops -O3 -march=native -gnatn is: Real cube Real type size is: 64 Computation time: 0.376393396 Computation time per iteration: 3.76393396000000E-04 Sum is: 7.68000000000000E+08 Complex cube Complex type size is: 128 Computation time: 0.848316916 Computation time per iteration: 8.48316916000000E-04 Sum is:( 7.68000000000000E+08, 7.68000000000000E+08) and again, compiling and running on Win10: Real cube Real type size is: 64 Computation time: 0.406157900 Computation time per iteration: 4.06157900000000E-04 Sum is: 7.68000000000000E+08 Complex cube Complex type size is: 128 Computation time: 0.807358900 Computation time per iteration: 8.07358900000000E-04 Sum is:( 7.68000000000000E+08, 7.68000000000000E+08) So, not bad at all, and my guess is that some thing could be improved. BTW, I think the the gprof is missing on GNAT CE on Win10/64bit (Linux distro has it). Regards, Darek P.S. Did anybody tried to use the FFTW with an old Ada binding (Linux/Win10). It partially works but I have some strange issues with it (depend on the platform either single precision or double precision is not working). On Tuesday, 24 March 2020 10:37:29 UTC+1, Jeffrey R. Carter wrote: > On 3/24/20 12:16 AM, darek wrote: > > > > In the case of Ada code, the complex operations are ~ 6 times slower that for the real numbers. > > With FSF GNAT 9.2.1 on Linux, compiled with -O2 -gnatn -fstack-check, on my > machine (Intel Core i7-6700HQ 2.6 GHz) the complex time is about 1.14 times the > real time. With -O3 -gnatpn, about 1.13 times. > > -- > Jeff Carter > "Now look, Col. Batguano, if that really is your name." > Dr. Strangelove > 31