- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just figured out that you can not call math functions when combining elemental functions and template classes:
[cpp]#include <cmath>
template<typename T>
class A {
public:
__attribute__((vector))
T b(T value)
{
return std::sqrt(value);
}
};
int main()
{
A classA;
float b = 4;
classA.b(b);
} [/cpp]
Error message:
[plain] asdf.cpp(13): error #2593: indirect call is not supported in vector function
return std::sqrt(value);
^ [/plain]
Compiler version:
[plain]icpc (ICC) 12.1.5 20120612
Copyright (C) 1985-2012 Intel Corporation. All rights reserved. [/plain]
I can work around this problem using typedefs, but it would be nice to support this with templates as well.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you try to compile your test-case without '__attribute__( ( vector ) )' for the function 'b'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see this error in an older version of 12.1. It looks like this was fixed in early August 2012 as our DPD200235034 in both 12.1 and 13.0. Please upgrade to a new version and sorry for the inconvenience.
Judy
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