- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I have three arrays of dimension n and same type: a(n), b(n) and c(n). I want to add the a and b and put the result into c.
Could you possibly rank the following implementations from most efficient to least efficient?
1. c = a + b
2. c(1:n) = a(1:n) + b(1:n)
3. forall(i=1:n) c(i) = a(i) + b(i)
Thank you for your input.
Kind regards,
Daniel.
I have three arrays of dimension n and same type: a(n), b(n) and c(n). I want to add the a and b and put the result into c.
Could you possibly rank the following implementations from most efficient to least efficient?
1. c = a + b
2. c(1:n) = a(1:n) + b(1:n)
3. forall(i=1:n) c(i) = a(i) + b(i)
Thank you for your input.
Kind regards,
Daniel.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may require ifort directive !dir$ ivdep to make #3 as effective as the other two.

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