- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had some C++ code using restrict that was compiling and running OK on MS7 using a 11.x version of ICC.
restrict double *vecArray = (double *) vec.data();
When I try to compile this code on ICC version 12.0.0 on Linux I get an error message:
error: "restrict" is not allowed
I'm using the -restrict compile flag.
Within the relevant code block the restrict statement is semantically accurate. I had it in there to tell the compiler not to worry about any aliasing ie more aggressive optimisation if possible.
Am I getting the error due to a more restrictive analysis on the part of the newer compiler version of where restrict is allowed?
Thanks
David
restrict double *vecArray = (double *) vec.data();
When I try to compile this code on ICC version 12.0.0 on Linux I get an error message:
error: "restrict" is not allowed
I'm using the -restrict compile flag.
Within the relevant code block the restrict statement is semantically accurate. I had it in there to tell the compiler not to worry about any aliasing ie more aggressive optimisation if possible.
Am I getting the error due to a more restrictive analysis on the part of the newer compiler version of where restrict is allowed?
Thanks
David
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The usual use of restrict to promote optimization would look like
double * restrict vecArray
i.e. restrict makes sense (to me) only in definition of a pointer.
It is true that the newer compilers are stricter on syntax analysis.
double * restrict vecArray
i.e. restrict makes sense (to me) only in definition of a pointer.
It is true that the newer compilers are stricter on syntax analysis.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The usual use of restrict to promote optimization would look like
double * restrict vecArray
i.e. restrict makes sense (to me) only in definition of a pointer.
It is true that the newer compilers are stricter on syntax analysis.
double * restrict vecArray
i.e. restrict makes sense (to me) only in definition of a pointer.
It is true that the newer compilers are stricter on syntax analysis.
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