Compile GPU code with the host SSE code

Hi,
I’m trying to compile host SSE code with GPU code. I added below compiler options to compile host SSE code.
-mmmx -msse2 -msse3 -msse4.1 -mavx

However, I’m getting below error with nvcc compiler.
Any fix?

/usr/local/cuda-7.0/bin/nvcc -ccbin g++ -m64 --compiler-options -fPIC -mmmx -msse2 -msse3 -msse4.1 -mavx -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -I/home/arup/projects/nvm/cuda/NVIDIA_CUDA-7.0_Samples/common/inc -O4 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -lrt -lm -c src/csdc_us.cu -o build/RELEASE/csdc_us.o -Iinc -I…/…/driver/csdc/src -I/home/arup/projects/nvm/cuda/NVIDIA-Linux-x86_64-346.87/kernel
nvcc fatal : redefinition of argument ‘machine’
make: *** [build/RELEASE/csdc_us.o] Error 1

#1

Try putting all the options you want to pass to the host compiler in quotes:

/usr/local/cuda-7.0/bin/nvcc -ccbin g++ -m64 --compiler-options “-fPIC -mmmx -msse2 -msse3 -msse4.1 -mavx” -gencode …

Or else pass them as a comma-separated list, but without spaces:

http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#options-for-passing-specific-phase-options

It works for me.

Thanks.