インテルC++コンパイラ9.0発表!
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
300:名無しさん@そうだ選挙に行こう 07/07/29 05:47:48 #include <iostream> template <class Type> class foo{ public: int x; foo(){x=0;} }; void main(void){ foo<float> f; int n=100; float *a=new float[n]; float *b=new float[n]; float *c=new float[n]; for (int i=0;i<n;i++){a[i]=rand();b[i]=rand();} for (int i=0;i<n;i++){c[i]=a[i]+b[i];} delete[] a,b,c; } これをver10で-xOを使ってコンパイルするとベクトル化されるのに、 #include <iostream> template <class Type> class foo{ public: int x; foo(){x=0;} ~foo(){} }; void main(void){ foo<float> f; int n=100; float *a=new float[n]; float *b=new float[n]; float *c=new float[n]; for (int i=0;i<n;i++){a[i]=rand();b[i]=rand();} for (int i=0;i<n;i++){c[i]=a[i]+b[i];} delete[] a,b,c; } これだと、ベクトル化されないのは何がいけないのでしょうか?CPUはAthlon64、OSはFC6です。 ver9では問題ありませんでした。
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5393日前に更新/84 KB
担当:undef