Hello.
My system is Fedora Linux. so GCC does not support OpenMP.
So, I successfully installed ICC. and some libraries.
I successfuly compile my sample openMP code by command line. and I work well.
To use openMP in CUDA,
when I modify common.mk file to openmp.mk
I can compile with cuda…
but, while I run, they does not detect thread nums (I use 4 but only 1 is used)
I chaged num_threads, but It does not work only 1 thread…
my openmp.mk is below I change compiler name and link library…
anyone success with ICC openmp?? how I set up openmp.mk?
OMP_LIB := /opt/intel/cce/10.1.015/lib
# Compilers
NVCC Â Â Â Â Â Â := nvcc
CXX Â Â Â Â Â Â Â := icc -openmp
CC Â Â Â Â Â Â Â Â := icc -openmp
LINK       := gcc   -fPIC
# Libs
LIB Â Â Â Â Â Â := -L$(CUDA_INSTALL_PATH)/lib -L$(LIBDIR) -L$(COMMONDIR)/lib
ifeq ($(USEDRVAPI),1)
  LIB += -lcuda -lcudart ${OPENGLLIB} $(PARAMGLLIB) $(CUDPPLIB) ${LIB}
else
  LIB += -lcudart ${OPENGLLIB} $(PARAMGLLIB) $(CUDPPLIB) ${LIB}
endif
LIB += -L$(OMP_LIB) -lguide  -lpthread
success in compile with command-line
[yhgon@cudap release]$ cd …
[yhgon@cudap hello]$ ./a.out
Hello World from thread = 1
Hello World from thread = 3
Hello World from thread = 2
Hello World from thread = 0
Number of threads = 4
fail in comple with upper makefile with nvcc
[yhgon@cudap release]$ ./t
Hello World from thread = 0
Number of threads = 1
sampe source ===============
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[]) {
int nthreads, tid;
/* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(nthreads, tid)
 {
 /* Obtain thread number */
 tid = omp_get_thread_num();
 printf("Hello World from thread = %d\n", tid);
 /* Only master thread does this */
 if (tid == 0)
   {
   nthreads = omp_get_num_threads();
   printf("Number of threads = %d\n", nthreads);
   }
 }  /* All threads join master thread and disband */
}