<?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 problem with clCreateCommandQueueWithProperties on Linux for NVIDIA Quadro K2200 in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-clCreateCommandQueueWithProperties-on-Linux-for/m-p/1071291#M4447</link>
    <description>Hello,

I want to use CUDA-8.0 and OpenCL on SuSE Linux Enterprise 12.1. Unfortunately NVIDIA supports only OpenCL 1.2, so that I've installed the latest version of the Intel OpenCL SDK as well. I get a warning about a deprecated function if I use  "clCreateCommandQueue ()" and my program breaks with a segmentation fault if I call "clCreateCommandQueueWithProperties ()" for my NVIDIA Quadro K2200 graphics card (it doesn't matter if I use Sun C, icc, or gcc). I assume the reason for the segmentation fault is that the graphics device supports only OpenCL 1.2 and "clCreateCommandQueueWithProperties ()" doesn't honour this fact. Now I have a more or less complicated code to create a command queue and to get my program working with different platforms (OpenCL 1.2 and OpenCL 2.x, Linux and Windows) and compilers. Why do I have to determine the OpenCL version of the device at run-time, if the OpenCL SDK reports CL_VERSION_2_0? In my opinion the library should automatically use the correct function and parameters if the device supports only OpenCL 1.2. I'm new to OpenCL so I may have misunderstood something or perhaps my program is even faulty. How can I create a command queue for OpenCL 1.2 and 2.x in a portable way, so that I don't get warnings about deprecated functions and I get a program that works if I compile it on different platforms with different compilers? I don't know how "clCreateCommandQueueWithProperties ()" will be translated for the device. Is it possible that the function doesn't work as expected if the device supports only OpenCL 1.2?

   #if !defined(CL_VERSION_2_0) || defined(__NVCC__)
      if (outOfOrderQueue == 1)
      {
	printf ("  Using out-of-order clCreateCommandQueue (...)\n\n");
	command_queue = clCreateCommandQueue (context, device_id,
			  CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &amp;amp;errcode_ret);
      }
      else
      {
	printf ("  Using in-order clCreateCommandQueue (...)\n\n");
	command_queue = clCreateCommandQueue (context, device_id, 0, &amp;amp;errcode_ret);
      }
    #else
      /* "deviceOpenCL_MajorVersion - '0'" converts char to int		*/
      if ((deviceOpenCL_MajorVersion - '0') == 2)
      {
	cl_queue_properties queueProps[] =
	  { CL_QUEUE_PROPERTIES,
	    (const cl_queue_properties) (CL_QUEUE_ON_DEVICE &amp;amp;&amp;amp;
	      CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE),
	    0
	  };
	printf ("  Using out-of-order clCreateCommandQueueWithProperties (...)\n\n");
	command_queue = clCreateCommandQueueWithProperties (context,
			  device_id, queueProps, &amp;amp;errcode_ret);
      }
      else
      {
        /* CL_VERSION_2_0 reported, but device supports only OpenCL 1.2 */
	if (outOfOrderQueue == 1)
	{
	  printf ("  Using out-of-order clCreateCommandQueue (...)\n\n");
	  command_queue = clCreateCommandQueue (context, device_id,
			    CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &amp;amp;errcode_ret);
	}
	else
	{
	  printf ("  Using in-order clCreateCommandQueue (...)\n\n");
	  command_queue = clCreateCommandQueue (context, device_id, 0, &amp;amp;errcode_ret);
	}
      }
    #endif
    CheckRetValueOfOpenCLFunction (errcode_ret);

I would be grateful for any comments entlighten my understanding of the problem and why I have to choose between clCreateCommandQueueWithProperties and clCreateCommandQueue myself when CL_VERSION_2_0 is reported. Thank you very much for any help in advance.

Siegmar</description>
    <pubDate>Tue, 01 Nov 2016 11:50:33 GMT</pubDate>
    <dc:creator>Siegmar_G_</dc:creator>
    <dc:date>2016-11-01T11:50:33Z</dc:date>
    <item>
      <title>problem with clCreateCommandQueueWithProperties on Linux for NVIDIA Quadro K2200</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-clCreateCommandQueueWithProperties-on-Linux-for/m-p/1071291#M4447</link>
      <description>Hello,

I want to use CUDA-8.0 and OpenCL on SuSE Linux Enterprise 12.1. Unfortunately NVIDIA supports only OpenCL 1.2, so that I've installed the latest version of the Intel OpenCL SDK as well. I get a warning about a deprecated function if I use  "clCreateCommandQueue ()" and my program breaks with a segmentation fault if I call "clCreateCommandQueueWithProperties ()" for my NVIDIA Quadro K2200 graphics card (it doesn't matter if I use Sun C, icc, or gcc). I assume the reason for the segmentation fault is that the graphics device supports only OpenCL 1.2 and "clCreateCommandQueueWithProperties ()" doesn't honour this fact. Now I have a more or less complicated code to create a command queue and to get my program working with different platforms (OpenCL 1.2 and OpenCL 2.x, Linux and Windows) and compilers. Why do I have to determine the OpenCL version of the device at run-time, if the OpenCL SDK reports CL_VERSION_2_0? In my opinion the library should automatically use the correct function and parameters if the device supports only OpenCL 1.2. I'm new to OpenCL so I may have misunderstood something or perhaps my program is even faulty. How can I create a command queue for OpenCL 1.2 and 2.x in a portable way, so that I don't get warnings about deprecated functions and I get a program that works if I compile it on different platforms with different compilers? I don't know how "clCreateCommandQueueWithProperties ()" will be translated for the device. Is it possible that the function doesn't work as expected if the device supports only OpenCL 1.2?

   #if !defined(CL_VERSION_2_0) || defined(__NVCC__)
      if (outOfOrderQueue == 1)
      {
	printf ("  Using out-of-order clCreateCommandQueue (...)\n\n");
	command_queue = clCreateCommandQueue (context, device_id,
			  CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &amp;amp;errcode_ret);
      }
      else
      {
	printf ("  Using in-order clCreateCommandQueue (...)\n\n");
	command_queue = clCreateCommandQueue (context, device_id, 0, &amp;amp;errcode_ret);
      }
    #else
      /* "deviceOpenCL_MajorVersion - '0'" converts char to int		*/
      if ((deviceOpenCL_MajorVersion - '0') == 2)
      {
	cl_queue_properties queueProps[] =
	  { CL_QUEUE_PROPERTIES,
	    (const cl_queue_properties) (CL_QUEUE_ON_DEVICE &amp;amp;&amp;amp;
	      CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE),
	    0
	  };
	printf ("  Using out-of-order clCreateCommandQueueWithProperties (...)\n\n");
	command_queue = clCreateCommandQueueWithProperties (context,
			  device_id, queueProps, &amp;amp;errcode_ret);
      }
      else
      {
        /* CL_VERSION_2_0 reported, but device supports only OpenCL 1.2 */
	if (outOfOrderQueue == 1)
	{
	  printf ("  Using out-of-order clCreateCommandQueue (...)\n\n");
	  command_queue = clCreateCommandQueue (context, device_id,
			    CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &amp;amp;errcode_ret);
	}
	else
	{
	  printf ("  Using in-order clCreateCommandQueue (...)\n\n");
	  command_queue = clCreateCommandQueue (context, device_id, 0, &amp;amp;errcode_ret);
	}
      }
    #endif
    CheckRetValueOfOpenCLFunction (errcode_ret);

I would be grateful for any comments entlighten my understanding of the problem and why I have to choose between clCreateCommandQueueWithProperties and clCreateCommandQueue myself when CL_VERSION_2_0 is reported. Thank you very much for any help in advance.

Siegmar</description>
      <pubDate>Tue, 01 Nov 2016 11:50:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-clCreateCommandQueueWithProperties-on-Linux-for/m-p/1071291#M4447</guid>
      <dc:creator>Siegmar_G_</dc:creator>
      <dc:date>2016-11-01T11:50:33Z</dc:date>
    </item>
    <item>
      <title>"Deprecated" has different</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-clCreateCommandQueueWithProperties-on-Linux-for/m-p/1071292#M4448</link>
      <description>&lt;P&gt;"Deprecated" has different meanings for different APIs.&amp;nbsp; For OpenCL, the meaning is:&lt;/P&gt;

&lt;P&gt;Deprecation: existing features are marked as deprecated if their usage is not recommended as that feature is being de-emphasized, superseded and may be removed from a future version of the specification.&lt;/P&gt;

&lt;P&gt;(Taken from the OpenCL 2.2 provisional spec glossary, where the working group clarified the definition.)&lt;/P&gt;

&lt;P&gt;Long story short, this means that you may continue to use the OpenCL 1.2 clCreateCommandQueue() function, even on OpenCL 2.0 implementations where the function is "deprecated".&amp;nbsp; The "deprecated" identifier is simply informational, to indicate that the function or feature may be removed from a future version of the specification.&lt;/P&gt;

&lt;P&gt;If the "deprecated" warning bothers you, you may suppress the warning by #defining CL_USE_DEPRECATED_OPENCL_1_2_APIS before #including CL.h.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 23:50:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-clCreateCommandQueueWithProperties-on-Linux-for/m-p/1071292#M4448</guid>
      <dc:creator>Ben_A_Intel</dc:creator>
      <dc:date>2016-11-01T23:50:17Z</dc:date>
    </item>
  </channel>
</rss>

