<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic -g option to clBuildProgram not accepted in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811790#M911</link>
    <description>Hello Daniel,&lt;BR /&gt;&lt;BR /&gt;Could you please make sure that your program selects Intel OpenCL platform during initialization. It looks like you have multiple OpenCL platforms installed on your system (since you are mentioning AMD and NVIDIA).&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Yuri</description>
    <pubDate>Fri, 10 Feb 2012 11:13:14 GMT</pubDate>
    <dc:creator>Yuri_K_Intel</dc:creator>
    <dc:date>2012-02-10T11:13:14Z</dc:date>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811789#M910</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to debug some OpenCL kernels with the Intel OpenCL SDK debugger integrated in VS2008. &lt;BR /&gt;The documentation states I have to pass "-g -s &lt;PATH-TO-SOURCE&gt;" as an option to clBuildProgram() but this results in a CL_BUILD_ERRORerror "Don't understand command line argument "-g"!".&lt;BR /&gt;&lt;BR /&gt;DoI need another OpenCL.dll driver? I've tried it bothon an AMD as a NVIDIA system.&lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;Daniel Dekkers&lt;/PATH-TO-SOURCE&gt;</description>
      <pubDate>Fri, 10 Feb 2012 09:56:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811789#M910</guid>
      <dc:creator>dozo1971</dc:creator>
      <dc:date>2012-02-10T09:56:03Z</dc:date>
    </item>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811790#M911</link>
      <description>Hello Daniel,&lt;BR /&gt;&lt;BR /&gt;Could you please make sure that your program selects Intel OpenCL platform during initialization. It looks like you have multiple OpenCL platforms installed on your system (since you are mentioning AMD and NVIDIA).&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Yuri</description>
      <pubDate>Fri, 10 Feb 2012 11:13:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811790#M911</guid>
      <dc:creator>Yuri_K_Intel</dc:creator>
      <dc:date>2012-02-10T11:13:14Z</dc:date>
    </item>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811791#M912</link>
      <description>Hi Yuri,&lt;BR /&gt;&lt;BR /&gt;Good point, wrote some code to check.&lt;BR /&gt;I havetwo OpenCL platforms:&lt;BR /&gt;The first platformis AMD, it has two devices, Caicos and Intel Core i7&lt;BR /&gt;The second platform is Intel  OpenCL, it has one device, Intel Core i7 (same name as above)&lt;BR /&gt;&lt;BR /&gt;So i guess i should use the second platform?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Daniel</description>
      <pubDate>Fri, 10 Feb 2012 12:40:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811791#M912</guid>
      <dc:creator>dozo1971</dc:creator>
      <dc:date>2012-02-10T12:40:48Z</dc:date>
    </item>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811792#M913</link>
      <description>Yes, exactly. To work with the Intel OpenCL kernel debugger you should use Intel platform.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Yuri</description>
      <pubDate>Fri, 10 Feb 2012 12:57:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811792#M913</guid>
      <dc:creator>Yuri_K_Intel</dc:creator>
      <dc:date>2012-02-10T12:57:23Z</dc:date>
    </item>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811793#M914</link>
      <description>Ok, I'm doing that but now clCreateContext() never returns...&lt;BR /&gt;&lt;BR /&gt;m_Context = clCreateContext(NULL, 1, &amp;amp;m_DeviceId, NULL, NULL, &amp;amp;l_Error);&lt;BR /&gt;&lt;BR /&gt;... where m_DeviceId is the (only) device on the second Intel platform.&lt;BR /&gt;&lt;BR /&gt;I've activated the "Enable OpenCL Kernel Debugging" check.&lt;BR /&gt;Windows firewall is turned off.&lt;BR /&gt;I'mlinking againstthe OpenCL.lib from the Intel OpenCL SDK.&lt;BR /&gt;In taskmanageri see a icldbgsrv.exe (Intel OpenCL Debugger) process, but nothingelse that could be related.&lt;BR /&gt;&lt;BR /&gt;Ehm...&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Feb 2012 13:25:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811793#M914</guid>
      <dc:creator>dozo1971</dc:creator>
      <dc:date>2012-02-10T13:25:37Z</dc:date>
    </item>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811794#M915</link>
      <description>&lt;PRE&gt;&lt;DIV class="line" id="LC3"&gt;Here is some utility code that I helped out on it shows you how you can make sure and get a context for the correct platform and vendor using the Khronos C++ wrapper which you can easily modify to work with the c version as the opencl wrapper will return the base data.&lt;BR /&gt;&lt;BR /&gt;You can either use the clCreateContext with the vendor enum or use arguments version.&lt;BR /&gt;&lt;BR /&gt;Note: This code isn't meant to handle every single possible option (clearly as we don't handle IBM, or Img Tech, or any others). I have included it here as it should show you how to write something similar for yourself so you can never/almost never worry about this stuff again and get to coding.&lt;BR /&gt;&lt;BR /&gt;Also it is way shorted with the C++ wrapper.&lt;BR /&gt;&lt;BR /&gt;If you want to see the rest it is at: &lt;A href="https://github.com/smistad/OpenCLUtilities" target="_blank"&gt;https://github.com/smistad/OpenCLUtilities&lt;/A&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;DIV class="line" id="LC20"&gt;enum cl_vendor {&lt;/DIV&gt;&lt;DIV class="line" id="LC21"&gt;VENDOR_ANY,&lt;/DIV&gt;&lt;DIV class="line" id="LC22"&gt;VENDOR_NVIDIA,&lt;/DIV&gt;&lt;DIV class="line" id="LC23"&gt;VENDOR_AMD,&lt;/DIV&gt;&lt;DIV class="line" id="LC24"&gt;VENDOR_INTEL&lt;/DIV&gt;&lt;DIV class="line" id="LC25"&gt;};&lt;/DIV&gt;&lt;/PRE&gt;&lt;BR /&gt;cl::Platform getPlatform(cl_device_type type, cl_vendor vendor) {&lt;/DIV&gt;&lt;DIV class="line" id="LC4"&gt;// Get available platforms&lt;/DIV&gt;&lt;DIV class="line" id="LC5"&gt;cl::vector&lt;:PLATFORM&gt; platforms;&lt;/:PLATFORM&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC6"&gt;cl::Platform::get(&amp;amp;platforms);&lt;/DIV&gt;&lt;DIV class="line" id="LC7"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC8"&gt;if(platforms.size() == 0)&lt;/DIV&gt;&lt;DIV class="line" id="LC9"&gt;throw cl::Error(1, "No OpenCL platforms were found");&lt;/DIV&gt;&lt;DIV class="line" id="LC10"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC11"&gt;int platformID = -1;&lt;/DIV&gt;&lt;DIV class="line" id="LC12"&gt;if(vendor != VENDOR_ANY) {&lt;/DIV&gt;&lt;DIV class="line" id="LC13"&gt;std::string find;&lt;/DIV&gt;&lt;DIV class="line" id="LC14"&gt;switch(vendor) {&lt;/DIV&gt;&lt;DIV class="line" id="LC15"&gt;case VENDOR_NVIDIA:&lt;/DIV&gt;&lt;DIV class="line" id="LC16"&gt;find = "NVIDIA";&lt;/DIV&gt;&lt;DIV class="line" id="LC17"&gt;break;&lt;/DIV&gt;&lt;DIV class="line" id="LC18"&gt;case VENDOR_AMD:&lt;/DIV&gt;&lt;DIV class="line" id="LC19"&gt;find = "Advanced Micro Devices";&lt;/DIV&gt;&lt;DIV class="line" id="LC20"&gt;break;&lt;/DIV&gt;&lt;DIV class="line" id="LC21"&gt;case VENDOR_INTEL:&lt;/DIV&gt;&lt;DIV class="line" id="LC22"&gt;find = "Intel";&lt;/DIV&gt;&lt;DIV class="line" id="LC23"&gt;break;&lt;/DIV&gt;&lt;DIV class="line" id="LC24"&gt;default:&lt;/DIV&gt;&lt;DIV class="line" id="LC25"&gt;throw cl::Error(1, "Invalid vendor specified");&lt;/DIV&gt;&lt;DIV class="line" id="LC26"&gt;break;&lt;/DIV&gt;&lt;DIV class="line" id="LC27"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC28"&gt;for(unsigned int i = 0; i &amp;lt; platforms.size(); i++) {&lt;/DIV&gt;&lt;DIV class="line" id="LC29"&gt;if(platforms&lt;I&gt;.getInfo&lt;CL_PLATFORM_VENDOR&gt;().find(find) != std::string::npos) {&lt;/CL_PLATFORM_VENDOR&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC30"&gt;try {&lt;/DIV&gt;&lt;DIV class="line" id="LC31"&gt;cl::vector&lt;:DEVICE&gt; devices;&lt;/:DEVICE&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC32"&gt;platforms&lt;I&gt;.getDevices(type, &amp;amp;devices);&lt;/I&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC33"&gt;platformID = i;&lt;/DIV&gt;&lt;DIV class="line" id="LC34"&gt;break;&lt;/DIV&gt;&lt;DIV class="line" id="LC35"&gt;} catch(cl::Error e) {&lt;/DIV&gt;&lt;DIV class="line" id="LC36"&gt;continue; &lt;/DIV&gt;&lt;DIV class="line" id="LC37"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC38"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC39"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC40"&gt;} else {&lt;/DIV&gt;&lt;DIV class="line" id="LC41"&gt;for(unsigned int i = 0; i &amp;lt; platforms.size(); i++) {&lt;/DIV&gt;&lt;DIV class="line" id="LC42"&gt;try {&lt;/DIV&gt;&lt;DIV class="line" id="LC43"&gt;cl::vector&lt;:DEVICE&gt; devices;&lt;/:DEVICE&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC44"&gt;platforms&lt;I&gt;.getDevices(type, &amp;amp;devices);&lt;/I&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC45"&gt;platformID = i;&lt;/DIV&gt;&lt;DIV class="line" id="LC46"&gt;break;&lt;/DIV&gt;&lt;DIV class="line" id="LC47"&gt;} catch(cl::Error e) {&lt;/DIV&gt;&lt;DIV class="line" id="LC48"&gt;continue; &lt;/DIV&gt;&lt;DIV class="line" id="LC49"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC50"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC51"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC52"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC53"&gt;if(platformID == -1) &lt;/DIV&gt;&lt;DIV class="line" id="LC54"&gt;throw cl::Error(1, "No compatible OpenCL platform found");&lt;/DIV&gt;&lt;DIV class="line" id="LC55"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC56"&gt;cl::Platform platform = platforms[platformID];&lt;/DIV&gt;&lt;DIV class="line" id="LC57"&gt;std::cout &amp;lt;&amp;lt; "Using platform vendor: " &amp;lt;&amp;lt; platform.getInfo&lt;CL_PLATFORM_VENDOR&gt;() &amp;lt;&amp;lt; std::endl;&lt;/CL_PLATFORM_VENDOR&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC58"&gt;return platform;&lt;/DIV&gt;&lt;DIV class="line" id="LC59"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC60"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC61"&gt;cl::Context createCLContextFromArguments(int argc, char ** argv) {&lt;/DIV&gt;&lt;DIV class="line" id="LC62"&gt;cl_device_type type = CL_DEVICE_TYPE_ALL;&lt;/DIV&gt;&lt;DIV class="line" id="LC63"&gt;cl_vendor vendor = VENDOR_ANY;&lt;/DIV&gt;&lt;DIV class="line" id="LC64"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC65"&gt;for(int i = 0; i &amp;lt; argc; i++) {&lt;/DIV&gt;&lt;DIV class="line" id="LC66"&gt;if(strcmp(argv&lt;I&gt;, "--device") == 0) {&lt;/I&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC67"&gt;if(strcmp(argv[i+1], "cpu") == 0) {&lt;/DIV&gt;&lt;DIV class="line" id="LC68"&gt;type = CL_DEVICE_TYPE_CPU;&lt;/DIV&gt;&lt;DIV class="line" id="LC69"&gt;} else if(strcmp(argv[i+1], "gpu") == 0) {&lt;/DIV&gt;&lt;DIV class="line" id="LC70"&gt;type = CL_DEVICE_TYPE_GPU;&lt;/DIV&gt;&lt;DIV class="line" id="LC71"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC72"&gt;i++;&lt;/DIV&gt;&lt;DIV class="line" id="LC73"&gt;} else if(strcmp(argv&lt;I&gt;, "--vendor") == 0) {&lt;/I&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC74"&gt;if(strcmp(argv[i+1], "amd") == 0) {&lt;/DIV&gt;&lt;DIV class="line" id="LC75"&gt;vendor = VENDOR_AMD;&lt;/DIV&gt;&lt;DIV class="line" id="LC76"&gt;} else if(strcmp(argv[i+1], "intel") == 0) {&lt;/DIV&gt;&lt;DIV class="line" id="LC77"&gt;vendor = VENDOR_INTEL;&lt;/DIV&gt;&lt;DIV class="line" id="LC78"&gt;} else if(strcmp(argv[i+1], "nvidia") == 0) {&lt;/DIV&gt;&lt;DIV class="line" id="LC79"&gt;vendor = VENDOR_NVIDIA;&lt;/DIV&gt;&lt;DIV class="line" id="LC80"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC81"&gt;i++;&lt;/DIV&gt;&lt;DIV class="line" id="LC82"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC83"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC84"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC85"&gt;return createCLContext(type, vendor);&lt;/DIV&gt;&lt;DIV class="line" id="LC86"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC87"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC88"&gt;cl::Context createCLContext(cl_device_type type, cl_vendor vendor) {&lt;/DIV&gt;&lt;DIV class="line" id="LC89"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC90"&gt;cl::Platform platform = getPlatform(type, vendor);&lt;/DIV&gt;&lt;DIV class="line" id="LC91"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC92"&gt;// Use the preferred platform and create a context&lt;/DIV&gt;&lt;DIV class="line" id="LC93"&gt;cl_context_properties cps[] = {&lt;/DIV&gt;&lt;DIV class="line" id="LC94"&gt;CL_CONTEXT_PLATFORM, &lt;/DIV&gt;&lt;DIV class="line" id="LC95"&gt;(cl_context_properties)(platform)(),&lt;/DIV&gt;&lt;DIV class="line" id="LC96"&gt;0&lt;/DIV&gt;&lt;DIV class="line" id="LC97"&gt;};&lt;/DIV&gt;&lt;DIV class="line" id="LC98"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC99"&gt;try {&lt;/DIV&gt;&lt;DIV class="line" id="LC100"&gt;cl::Context context = cl::Context(type, cps);&lt;/DIV&gt;&lt;DIV class="line" id="LC101"&gt;&lt;/DIV&gt;&lt;DIV class="line" id="LC102"&gt;return context;&lt;/DIV&gt;&lt;DIV class="line" id="LC103"&gt;} catch(cl::Error error) {&lt;/DIV&gt;&lt;DIV class="line" id="LC104"&gt;throw cl::Error(1, "Failed to create an OpenCL context!");&lt;/DIV&gt;&lt;DIV class="line" id="LC105"&gt;}&lt;/DIV&gt;&lt;DIV class="line" id="LC106"&gt;}&lt;BR /&gt;&lt;BR /&gt;Let me know if you have any quesitons&lt;/DIV&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2012 13:57:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811794#M915</guid>
      <dc:creator>Jim_Vaughn</dc:creator>
      <dc:date>2012-02-10T13:57:19Z</dc:date>
    </item>
    <item>
      <title>-g option to clBuildProgram not accepted</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811795#M916</link>
      <description>Hi Daniel,&lt;BR /&gt;&lt;BR /&gt;Just to be clear, does your code work with the Intel OpenCL device without debugging?</description>
      <pubDate>Fri, 10 Feb 2012 19:18:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/g-option-to-clBuildProgram-not-accepted/m-p/811795#M916</guid>
      <dc:creator>Eli_Bendersky__Intel</dc:creator>
      <dc:date>2012-02-10T19:18:49Z</dc:date>
    </item>
  </channel>
</rss>

