tags:

views:

100

answers:

2

It it possible to use openMP pragmas in the CUDA-Files (not in the kernel code)?

I will combine gpu and cpu computation. But nvvc compiler fails with "cannot find Unknown option 'openmp' ", if i am linking the porgram with a opnemp option (under linux)

A wayaround is to use openMP-statments only in c/c++ files.

+1  A: 

I've just found this

http://www.cse.buffalo.edu/faculty/miller/Courses/CSE710/heavner.pdf

Page 25 says:

With gcc: -#include omp.h

Add -fompenmp flag

With nvcc, this should be –Xcompiler –fopenmp as this needs to be passed directly to gcc -Xcompiler passes flags directly to host compiler

Add -lgomp flag

I haven't tried it yet...

Saludos, Javier Ruiz

Javier Ruiz
A: 

The solution for the Visual Studio found from the nvidia-forum:

add the '/openmp'-flag to the Extra C++ Options in cuda build rules. I will try the linux solution later.

LonliLokli