- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Given some code like this where a class inherits from a template class, the intel c++ compiler is about 100 times slower than g++ at newing an array:
class A {
public:
};
template
class B : public T{
public:
B(){}
};
void someFunction {
int numPixels = 1000000;
B * newPixels = new B[numPixels];
}
This may seem like strange code, but unfortunately a lot of our code has to be written like this for a number of reasons. If you remove the default constructor it fixes the problem, but unfortunately in our real code we have non-default constructors as well (so we need the default one). I realise we could just do a malloc or the like, ...
Given some code like this where a class inherits from a template class, the intel c++ compiler is about 100 times slower than g++ at newing an array:
class A {
public:
};
template
class B : public T{
public:
B(){}
};
void someFunction {
int numPixels = 1000000;
B * newPixels = new B[numPixels];
}
This may seem like strange code, but unfortunately a lot of our code has to be written like this for a number of reasons. If you remove the default constructor it fixes the problem, but unfortunately in our real code we have non-default constructors as well (so we need the default one). I realise we could just do a malloc or the like, ...
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ben,
Is the optimizer by chance turned off (using -g)? If so, try using -O explicitly. If not, you should report this as a bug to https://premier.intel.com , where you'll be prompted for some important system parameters upon filing the ticket.
If possible, it would be helpful to have a main function to demonstrate/drive the 100x slowdown you describe.
-- MicahE
Is the optimizer by chance turned off (using -g)? If so, try using -O explicitly. If not, you should report this as a bug to https://premier.intel.com , where you'll be prompted for some important system parameters upon filing the ticket.
If possible, it would be helpful to have a main function to demonstrate/drive the 100x slowdown you describe.
-- MicahE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Micah,
I'm attaching a main.cpp which will exhibit the behaviour. The two compile lines are as follow:
icpc -axNP -mcpu=pentium4 -msse2 -ansi-alias -funroll-loops -static -march=pentium4 -O3 main.cpp
and
g++ -mcpu=pentium4 -msse2 -funroll-loops -static -march=pentium4 -O3 main.cpp
The intel version takes about 4.5 secs and the g++ version about 0.04. I'll take your advice and log this as a bug, but I've attached the file in case you're interested.
Thanks
Ben
I'm attaching a main.cpp which will exhibit the behaviour. The two compile lines are as follow:
icpc -axNP -mcpu=pentium4 -msse2 -ansi-alias -funroll-loops -static -march=pentium4 -O3 main.cpp
and
g++ -mcpu=pentium4 -msse2 -funroll-loops -static -march=pentium4 -O3 main.cpp
The intel version takes about 4.5 secs and the g++ version about 0.04. I'll take your advice and log this as a bug, but I've attached the file in case you're interested.
Thanks
Ben
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