Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7646 Discussions

What is the difference between __restrict and restrict?

Jayden_S_
Beginner
193 Views

I check them in my code and find __restrict gives better performance than restrict when used for pointers with intel c++ compiler. I use #pragma omp parallel for and #pragma ivdep for my loop. What is the difference between __restrict and restrict?

0 Kudos
2 Replies
TimP
Black Belt
193 Views
restrict doesn't take effect without std=c99 or qrestrict. Not knowing your specific context, I prefer__restrict for that purpose in c++.
Judith_W_Intel
Employee
193 Views

 

In the compiler itself these are synonyms. As Tim pointed out it is just a question of which version is allowed in which language dialect...

Judy

Reply