comp.lang.ada
 help / color / mirror / Atom feed
From: darek <darek.maksimiuk@gmail.com>
Subject: Re: GNAT vs Matlab - operation on multidimensional complex matrices
Date: Tue, 24 Mar 2020 07:55:44 -0700 (PDT)
Date: 2020-03-24T07:55:44-07:00	[thread overview]
Message-ID: <b051ea09-fc07-4852-82b8-c65a4ffd5d1a@googlegroups.com> (raw)
In-Reply-To: <r5ckcn$26v$1@dont-email.me>

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

  reply	other threads:[~2020-03-24 14:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 23:16 GNAT vs Matlab - operation on multidimensional complex matrices darek
2020-03-24  2:07 ` johnscpg
2020-03-24  6:40 ` J-P. Rosen
2020-03-24  9:37 ` Jeffrey R. Carter
2020-03-24 14:55   ` darek [this message]
2020-03-24 15:44 ` johnscpg
2020-03-31 17:25 ` Shark8
2020-03-31 19:20   ` Simon Wright
2020-03-31 19:54     ` Shark8
2020-04-29 21:08     ` vincent.diemunsch
2020-04-01 11:01   ` darek
2020-04-01 15:01     ` J-P. Rosen
2020-04-01 16:39       ` darek
2020-04-01 17:15         ` J-P. Rosen
2020-03-31 20:05 ` Shark8
2020-03-31 20:51   ` Jeffrey R. Carter
2020-06-08 17:42 ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox