Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7939 Discussions

What is the difference between __restrict and restrict?

Jayden_S_
Beginner
622 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
Honored Contributor III
622 Views
restrict doesn't take effect without std=c99 or qrestrict. Not knowing your specific context, I prefer__restrict for that purpose in c++.
0 Kudos
Judith_W_Intel
Employee
622 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

0 Kudos
Reply