CUDA with ICC .. how I change make file?


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 file to

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 is below I change compiler name and link library…

anyone success with ICC openmp?? how I set up

OMP_LIB := /opt/intel/cce/10.1.015/lib

# Compilers

NVCC Â Â Â Â Â Â := nvcc

CXX Â Â Â Â Â Â Â := icc -openmp

CC Â Â Â Â Â Â Â Â := icc -openmp

LINK       := gcc   -fPIC

# Libs


ifeq ($(USEDRVAPI),1)

 Â Â LIB += -lcuda -lcudart ${OPENGLLIB} $(PARAMGLLIB) $(CUDPPLIB) ${LIB}




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 */


ICC is not currently supported. A future CUDA release will include ICC support.