- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use CUDA with TBB on VS 2008, Vista. I got a compilation error saying "__alignof__" is undefined. I wrote a small sample program to reproduce the error. The following code gives an error when I compile it with nvcc. For some reasons, after the compilation by cudafe++, the __alignof operator inside the template function gets converted to __alignof__ and I am getting an error since __alignof__ is not defined. This problem doesn't happen if I don't use a template b'coz the __alignof operator gets evaluated before it reaches cudafe++. Has anyone else faced this problem or have a solution for it? (I tried to go through all possible header files to find where __alignof would be defined as __alignof__. But I could not find any.)
Thanks in advance :)
(PS: I have created a thread in the CUDA forum too. I thought may be someone here could have faced this issue.)
Thanks,
Balaji
#include
class A{
int a;double b;
};
template
void myfunc()
{
printf("\nAlignof: %d\n",__alignof(T));
}
int main()
{
myfunc();
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot answer for your specific problem (as I cannot reproduce it) however a related problem occured and was reported elsewhere on this forum which may be the cause for your problem.
What was happening was a problem in the template token parsing.
The solution was to add white space between your tokens.
As to if this fixes your problem you will have to run a simple experiment.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Balaji
Quoting - jimdempseyatthecove
I cannot answer for your specific problem (as I cannot reproduce it) however a related problem occured and was reported elsewhere on this forum which may be the cause for your problem.
What was happening was a problem in the template token parsing.
The solution was to add white space between your tokens.
As to if this fixes your problem you will have to run a simple experiment.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tried it
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page