OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

how to pass -D preprocessor define to VS 2010 offline compiler plugin?

Volker_Bruns
Beginner
479 Views

Hi,

good job on the SDK, intel! I am using the 2013 SDK version with the plugin for Visual Studio 2010.

in my cl code, I want to be able to do this:

#ifdef NAMEOFDEFINE
//some work
#endif

How do I define NAMEOFDEFINE?
I tried -D NAMEOFDEFINE, -DNAMEOFDEFINE, -D NAMEOFDEFINE = 1, -DNAMEOFDEFINE=1 both in the project's Intel SDK property sheet's "additional build option" field and in the command line's "additional options" field, but to no avail. If I specify it in the project settings, it does show up in the individual cl file's settings as well, as expected. However, when I offline-compile the file, the output window log echos the used build options ("Using build options:"), but only the -I includes are listed, not my custom -D parameter.

What am I missing? Looking forward to your insights.
Cheers

0 Kudos
3 Replies
Oded_P_Intel
Employee
479 Views

Hi,

 

Please add this line:

OTHER="%(Intel_OpenCL_Build_Rules.OTHER)"

after this line (88):

IR="%(Intel_OpenCL_Build_Rules.IR)"

In the file IntelOpenCL.targets located in “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations”

Please make sure you don’t erase any line from the original file and keep the indentation.

This should fix the issue for every project you create after this fix is applied.

This fix will be included in the next Intel® SDK for OpenCL* Applications.

 

Best Regards,

Oded

 

0 Kudos
Oded_P_Intel
Employee
479 Views

BTW, this will also fix existing projects, but you will need to re-open them in Visual Studio.
 
Best Regards,
Oded

0 Kudos
Volker_Bruns
Beginner
479 Views

works like a charm. Thanks!

0 Kudos
Reply