<?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 Hi MarcelLD, in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176600#M6645</link>
    <description>&lt;P&gt;Hi MarcelLD,&lt;/P&gt;&lt;P&gt;A model number for the system if applicable can also be useful.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2019 22:13:10 GMT</pubDate>
    <dc:creator>Michael_C_Intel1</dc:creator>
    <dc:date>2019-04-05T22:13:10Z</dc:date>
    <item>
      <title>Example shows CL_DEVICE_NOT_FOUND</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176598#M6643</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I started with this guide: &lt;A href="https://software.intel.com/en-us/articles/sdk-for-opencl-2019-gsg-windows-os"&gt;https://software.intel.com/en-us/articles/sdk-for-opencl-2019-gsg-windows-os&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, executing the template program results in "clGetDeviceIDs() returned CL_DEVICE_NOT_FOUND". What did I do wrong? I could find my CPU and GPU at the Platform Info like the guide showed it. I have the i5-4670K with Intel HD Graphics 4600. I tried already repairing the installation. That does not help. Is there something wrong with my runtime installation or is just my cpu too old? :(&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 23:59:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176598#M6643</guid>
      <dc:creator>lolxdfly</dc:creator>
      <dc:date>2019-03-26T23:59:07Z</dc:date>
    </item>
    <item>
      <title>Hi MarcelLD,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176599#M6644</link>
      <description>&lt;P&gt;Hi MarcelLD,&lt;/P&gt;&lt;P&gt;Thanks for the feedback.&lt;/P&gt;&lt;P&gt;If platform info dialogs can enumerate and give back OpenCL platform and device info the system setup is likely correct.&lt;/P&gt;&lt;P&gt;Can you provide some system information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What Intel graphics driver are you using? Try Device Manager and getting the version string from "Display Adapters-&amp;gt;Intel(R) &lt;EM&gt;[ hd , iris, iris pro ],&amp;nbsp;&lt;/EM&gt;Graphics ###", Driver Tab, Driver Version?&lt;/LI&gt;&lt;LI&gt;Which program are you executing? Is it one of the programs from a MSVS template? Which template?&lt;/LI&gt;&lt;LI&gt;How is it being executed? From the command line or from the IDE?&lt;/LI&gt;&lt;LI&gt;Which version of the SDK or OpenCL tools is in use...&amp;nbsp;Which version of MSVS?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Can you show a screen shot or full console output of the error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 22:12:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176599#M6644</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-04-05T22:12:29Z</dc:date>
    </item>
    <item>
      <title>Hi MarcelLD,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176600#M6645</link>
      <description>&lt;P&gt;Hi MarcelLD,&lt;/P&gt;&lt;P&gt;A model number for the system if applicable can also be useful.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 22:13:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176600#M6645</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-04-05T22:13:10Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176601#M6646</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;the device manager shows "Intel (R) HD Graphics 4600" with Driver Version "20.19.15.4531".&lt;/P&gt;&lt;P&gt;I use the GPUOpenCLProject-Template from MSVS. Since I use Win10 I had to change the Windows SDK Version from 8.1 to 10.0.14393.0. I also tried different Platfrom Targets (Win32/x64), but executing the Programm always results in CL_DEVICE_NOT_FOUND:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" src="http://i.epvpimg.com/96u3gab.png" /&gt;&lt;/P&gt;&lt;P&gt;I tried to start it from IDE with the Local Windows Debugger, with double clicking the .exe-file or with CLI. It's always this error.&lt;/P&gt;&lt;P&gt;I use VS2017 Enterprise with the tools from Intel Studio 2019.3.063 and the Intel Graphics Driver Verison 15.40.42.5063.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 22:39:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176601#M6646</guid>
      <dc:creator>lolxdfly</dc:creator>
      <dc:date>2019-04-05T22:39:00Z</dc:date>
    </item>
    <item>
      <title>Hi MarcelLD,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176602#M6647</link>
      <description>&lt;P&gt;Hi MarcelLD,&lt;/P&gt;&lt;P&gt;Thanks for the details... What are the two platforms and devices per the platform info dialog... Can you expose the drop downs? Example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="sdk2019-infotree.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10345i4275510DC86DFBC4/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="sdk2019-infotree.png" alt="sdk2019-infotree.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do you have any other accelerators on the system?&lt;/P&gt;&lt;P&gt;At the risk of making an erroneous prediction:&amp;nbsp;I'm thinking it's more likely the article and sample template are stale&amp;nbsp;and your system is fine. Per the source code, the program looks for the first platform that has a GPU device type. On the example system in the article, it finds a GPU device in the first platform interrogated so no issues are observed. On yours you may have newer or different platforms that are interrogated in a different order. It looks like the OpenCL-C kernel is still executing successfully and that the error emitted from the host API could have been programmed more clearly.&lt;/P&gt;&lt;P&gt;I recommend adding some cout &amp;lt;&amp;lt; or printf(...) debugging and emitting detected parameters in the template program in particular if you are new to OpenCL... or breakpoint pausing and inspecting interrogation variables with the GUI&amp;nbsp;debugger... hopefully it will make the picture clear quickly.&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2019 02:11:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176602#M6647</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-04-06T02:11:22Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176603#M6648</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;this is my platform info:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" src="http://i.epvpimg.com/eCgVcab.png" /&gt;&lt;/P&gt;&lt;P&gt;I have a Nvidia Graphics card too. But I have not installed OpenCL drivers for this card.&lt;/P&gt;&lt;P&gt;To check if the kernel is executed sucessfully I moved to a different test code:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;fstream&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;lt;memory&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;

#define __CL_ENABLE_EXCEPTIONS
#include &amp;lt;CL/cl.hpp&amp;gt;

int main( int argc, char** argv ) {

    const int N_ELEMENTS=1024*1024;
    unsigned int platform_id=0, device_id=0;

    try{
        std::unique_ptr&amp;lt;int[]&amp;gt; A(new int[N_ELEMENTS]);
        std::unique_ptr&amp;lt;int[]&amp;gt; B(new int[N_ELEMENTS]);
        std::unique_ptr&amp;lt;int[]&amp;gt; C(new int[N_ELEMENTS]);

        for( int i = 0; i &amp;lt; N_ELEMENTS; ++i ) {
            A&lt;I&gt; = i;
            B&lt;I&gt; = i;
        }

        // Query for platforms
        std::vector&amp;lt;cl::Platform&amp;gt; platforms;
        cl::Platform::get(&amp;amp;platforms);

        // Get a list of devices on this platform
        std::vector&amp;lt;cl::Device&amp;gt; devices;
        platforms[platform_id].getDevices(CL_DEVICE_TYPE_GPU, &amp;amp;devices); // Select the platform.

        // Create a context
        cl::Context context(devices);

        // Create a command queue
        cl::CommandQueue queue = cl::CommandQueue( context, devices[device_id] );   // Select the device.

        // Create the memory buffers
        cl::Buffer bufferA=cl::Buffer(context, CL_MEM_READ_ONLY, N_ELEMENTS * sizeof(int));
        cl::Buffer bufferB=cl::Buffer(context, CL_MEM_READ_ONLY, N_ELEMENTS * sizeof(int));
        cl::Buffer bufferC=cl::Buffer(context, CL_MEM_WRITE_ONLY, N_ELEMENTS * sizeof(int));

        // Copy the input data to the input buffers using the command queue.
        queue.enqueueWriteBuffer( bufferA, CL_FALSE, 0, N_ELEMENTS * sizeof(int), A.get() );
        queue.enqueueWriteBuffer( bufferB, CL_FALSE, 0, N_ELEMENTS * sizeof(int), B.get() );

        // Read the program source
        std::ifstream sourceFile("vector_add_kernel.cl");
        std::string sourceCode( std::istreambuf_iterator&amp;lt;char&amp;gt;(sourceFile), (std::istreambuf_iterator&amp;lt;char&amp;gt;()));
        cl::Program::Sources source(1, std::make_pair(sourceCode.c_str(), sourceCode.length()));

        // Make program from the source code
        cl::Program program=cl::Program(context, source);

        // Build the program for the devices
        program.build(devices);

        // Make kernel
        cl::Kernel vecadd_kernel(program, "vecadd");

        // Set the kernel arguments
        vecadd_kernel.setArg( 0, bufferA );
        vecadd_kernel.setArg( 1, bufferB );
        vecadd_kernel.setArg( 2, bufferC );

        // Execute the kernel
        cl::NDRange global( N_ELEMENTS );
        cl::NDRange local( 256 );
        queue.enqueueNDRangeKernel( vecadd_kernel, cl::NullRange, global, local );

        // Copy the output data back to the host
        queue.enqueueReadBuffer( bufferC, CL_TRUE, 0, N_ELEMENTS * sizeof(int), C.get() );

        // Verify the result
        bool result=true;
        for (int i=0; i&amp;lt;N_ELEMENTS; i ++)
            if (C&lt;I&gt; !=A&lt;I&gt;+B&lt;I&gt;) {
                result=false;
                break;
            }
        if (result)
            std::cout&amp;lt;&amp;lt; "Success!\n";
        else
            std::cout&amp;lt;&amp;lt; "Failed!\n";

    }
    catch(cl::Error err) {
        std::cout &amp;lt;&amp;lt; "Error: " &amp;lt;&amp;lt; err.what() &amp;lt;&amp;lt; "(" &amp;lt;&amp;lt; err.err() &amp;lt;&amp;lt; ")" &amp;lt;&amp;lt; std::endl;
        return( EXIT_FAILURE );
    }

    std::cout &amp;lt;&amp;lt; "Done.\n";
    return( EXIT_SUCCESS );
}
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;This code prints "Error clGetDeviceIDs(-1)". That the same issue. If I add "CL_DEVICE_TYPE_CPU" to "platforms[platform_id].getDevices()" this code runs perfect... but on the CPU and not on the GPU.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Marcel&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2019 12:12:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176603#M6648</guid>
      <dc:creator>lolxdfly</dc:creator>
      <dc:date>2019-04-07T12:12:00Z</dc:date>
    </item>
    <item>
      <title>Hi MarcelLD,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176604#M6649</link>
      <description>&lt;P&gt;Hi MarcelLD,&lt;/P&gt;&lt;P&gt;Thanks for the clear example... A long winded comment may help newer users observing forums:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The system screen shot&amp;nbsp;has two OpenCL platforms exposed...&lt;UL&gt;&lt;LI&gt;The first is offered by Intel® CPU Runtime for OpenCL™ Applications. This platform is associated with a runtime intended to enable Windows OS based Intel platforms without Intel Graphics.&lt;/LI&gt;&lt;LI&gt;The second platform is offered by the Intel Graphics Driver package for Windows OS. It contains a CPU and Intel Graphics implementations for OpenCL.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Typically, most systems would not see both platforms installed on Windows OS.&lt;UL&gt;&lt;LI&gt;A. If the system is an Intel Graphics capable platform, Windows OS will have the graphics driver preinstalled... so there may not be the&amp;nbsp;need to have the separate CPU runtime. Of course, there may be graphics driver updates.&lt;/LI&gt;&lt;LI&gt;B. If they have an Intel system without Intel graphics, the system administrator&amp;nbsp;looks to download the CPU runtime. The graphics runtime doesn't apply because the system doesn't have the hardware.&lt;/LI&gt;&lt;LI&gt;Note: we are actively exploring making deployment of each of these simpler for users and developers alike.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;When the C++ wrapper asks a platform for&amp;nbsp;a device&amp;nbsp;of a type that doesn't exist with
&lt;PRE class="brush:cpp; class-name:dark;"&gt;cl::Platform::getDevice(&amp;nbsp; cl_device_type&amp;nbsp;type, vector&amp;lt;&amp;nbsp;Device&amp;nbsp;&amp;gt; *&amp;nbsp;devices )&lt;/PRE&gt;
it will return an error per the specification:
&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.khronos.org/OpenCL-CLHPP/classcl_1_1_platform.html#abf18ee63c06c9cbec5931fe391071b14"&gt;Khronos* OpenCL™ C++ Bindings&amp;nbsp;Reference&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clGetDeviceIDs.html"&gt;Khronos* OpenCL™ clGetDeviceIDs(...) reference&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;I'll add this&amp;nbsp;explanation to the article you visited, and ask the dev team to update the sample to be more clear about platforms being interrogated.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Thanks for the feedback.&lt;/P&gt;
&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 01:09:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Example-shows-CL-DEVICE-NOT-FOUND/m-p/1176604#M6649</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-04-10T01:09:22Z</dc:date>
    </item>
  </channel>
</rss>

