- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I dont believe that :
fortran codes costs 1.5s
[fortran]use rand_int real(8):: aa(573,573),bb(573,568),cc(573,568) aa=rand(aa) bb=rand(bb) cc=matmul(aa,bb)[/fortran]matlab codes costs 0.05s
[bash]aa=rand(573,573); bb=rand(573,568); cc=aa*bb;[/bash]
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do matlab really computes product of two matrices before accessing its values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I dont understand, all the codes is here, there is no additional codes, and the'rand' function get matrixs differently every time, so i think it did compute product.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to sum all elements in resulting matrix and measure time again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i tried sum them, fortran codes costs "0.00000000 sec"
matlab costs "0.0005 sec"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
and if i switch the opimization to "/O3" , fortran codes preformed better than before,but also slower than Matlab if multiply in 100 loops

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page