Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to #include <omp.h> in my C/C++ sources?

Tags:

c

gcc

openmp

Is it necessary to include omp.h in my C/C++ sources? Why? Or why not? Does the gcc compiler include it by default when used with the -fopenmp flag? It doesn't seem te make a differance.

like image 455
nieldw Avatar asked Mar 01 '10 19:03

nieldw


People also ask

Should I or do I need to?

I would say that "should" implies some sort of option, where it is more of a suggestion. Whereas "need to" implies necessity (obviously ;-) which means that any other option leaves something out.

Do I need or will I need?

They are both correct. The would one sounds less direct and is probably a good choice if you want to be somewhat polite. Show activity on this post. Would sounds conditional or hypothetical, so it should be used when expressing a possibility rather than an expected event.

Should I need to meaning?

The phrase should have to is also used in hypotheticals to mean "should find it necessary to"--in other words, it means "(the subject) is in a situation in which it is necessary to." Here's an example: If passengers should have to evacuate, lights leading to the emergency doors will be illuminated.

Is it grammatically correct need to?

A: “Need” is a confusing verb. But the short answer is that your first examples (using “need to” to replace “must” or “should” or “ought to” or “have to”) are grammatically correct. I'll get to the Kmart example later. As a verb, “need” can be either the main verb (“he needs glasses”) or the auxiliary.


1 Answers

You only need it to call OMP APIs. If all you need are pragmas you don't need to include it.

like image 91
bmargulies Avatar answered Sep 20 '22 06:09

bmargulies