- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi to everyone,
I have a problem with the SDK plugin for Visual Studio 2010. In my kernel I add several MACROS using the -D flag inside the options argument of the clBuildProgram function. However, this is not recognized by the Intel OpenCL SDK plugin, therefore it throws several "use of undeclared identifier" errors and I am not able to run my program.
I am able to run the Kernel if I disable the plugin, but it would be nice to be able to use it, so is there a way to fix this, or I should explicitly declare this macros inside my kernel to be able to debug it using the VS plugin?
Thanks for your help!
PS: As a small example, I have defined in my .cl file the following struct:
typedef struct{ double zbound[MXREG]; int nzb; } Geom;
Therefore, I define MXREG using the -D flag when calling clBuildProgram:
char options[64]; sprintf(options, "-DMXREG=%d, geom.nzb); cl_program program; program = oclBuildProgram(device, context, PROGRAM_FILE, options);
This works perfectly when the OpenCL plugin is not used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Edgardo,
Have you added these options to OpenCL Options line on the Build Options tab?
I am using the latest version of the INDE tools (https://software.intel.com/en-us/intel-inde ) and this option works for me (try to upgrade to the latest version of INDE and see if you still have an issue):
Using build options: -DMXREG=1024
OpenCL Intel(R) Graphics device was found!
Device name: Intel(R) Iris(TM) Pro Graphics 5200
Device version: OpenCL 1.2
Device vendor: Intel(R) Corporation
Device profile: FULL_PROFILE
fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.
Build succeeded!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Edgardo,
Have you added these options to OpenCL Options line on the Build Options tab?
I am using the latest version of the INDE tools (https://software.intel.com/en-us/intel-inde ) and this option works for me (try to upgrade to the latest version of INDE and see if you still have an issue):
Using build options: -DMXREG=1024
OpenCL Intel(R) Graphics device was found!
Device name: Intel(R) Iris(TM) Pro Graphics 5200
Device version: OpenCL 1.2
Device vendor: Intel(R) Corporation
Device profile: FULL_PROFILE
fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.
Build succeeded!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Robert, your suggestion worked!... thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings,
I have the same problem , however, the value of the passed option is only known at runtime, (i.e. the 1024 in the above example is unknown at compile time) , how can I handle this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you need the application to update the value then you'll need a combination of the two:
1) Set -DMXREG in the Code Builder properties. This is to help with the Code Builder compilation so you won't see errors for missing symbols at compile time.
2) Set the runtime value in the build options.
char options[64]; sprintf(options, "-g -s \"./source.cl\" -DMXREG=%d, geom.nzb); cl_program program; program = oclBuildProgram(device, context, PROGRAM_FILE, options);
In my tests the value in #1 was overwritten when the code was recompiled at runtime. When a breakpoint was applied in in the kernel I coudl see the value from step2.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page