Matlab+CUDA : -deviceemu in ? device emulation using nvmex

Hi ,

My project involves accelerating a matlab framework using CUDA, so i use the nvmex to compile my .cu files.I would like to add some printf() statements in the kernel to do some basic debugging.For this i would have to compile with device emulation mode.So here is the problem I face.

I guess i have to add the -deviceemu flag somewhere in the file.But have no clue where to add it … I did play around with it for a while but gave up…
Can someone help with where exactly in the file i need to make the change?