Results 1 to 5 of 5

Thread: In the case the 2 or more platforms is aviailable

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    7

    In the case the 2 or more platforms is aviailable

    What a case is it expected when the API function clGetPlatformIDs returns the value that the num_platforms is 2 or more?

  2. #2
    Junior Member
    Join Date
    Apr 2009
    Posts
    27

    Re: In the case the 2 or more platforms is aviailable

    The Compute working group at Khronos is working on a ICD that will allow mutiple vendor implementations to be present on the same machine and these will be exposed through platforms. For example, vendor A may take platform ID 1, vendor B platform ID 2, and so on.

    The folllowing code, using the C++ bindings shows how to enumerate all present platforms:

    Code :
        cl_int err;
     
        // Plaform info
        cl::vector<cl::Platform> platforms;
        err = cl::Platform::get(&platforms);
     
        checkErr(
            err && (platforms.size() == 0 ? -1 : CL_SUCCESS),
            "cl::Platform::get()");
     
        // Iteratate over platforms
        std::cout << "Number of platforms:\t\t\t\t " 
                  << platforms.size() 
                  << std::endl;
        for (cl::vector<cl::Platform>::iterator i = platforms.begin(); 
             i != platforms.end(); 
             ++i) {
            std::cout << "  Plaform Profile:\t\t\t\t "    
                      << (*i).getInfo<CL_PLATFORM_PROFILE>().c_str() 
                      << std::endl; 
            std::cout << "  Plaform Version:\t\t\t\t "    
                      << (*i).getInfo<CL_PLATFORM_VERSION>().c_str() 
                      << std::endl; 
            std::cout << "  Plaform Name:\t\t\t\t\t "     
                      << (*i).getInfo<CL_PLATFORM_NAME>().c_str() 
                      << std::endl; 
            std::cout << "  Plaform Vendor:\t\t\t\t "   
                      << (*i).getInfo<CL_PLATFORM_VENDOR>().c_str() << std::endl; 
            if ((*i).getInfo<CL_PLATFORM_EXTENSIONS>().size() > 0) {
                std::cout << "  Plaform Extensions:\t\t\t " 
                          << (*i).getInfo<CL_PLATFORM_EXTENSIONS>().c_str() 
                          << std::endl; 
            }
        }

    I hope this helps.

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    7

    Re: In the case the 2 or more platforms is aviailable

    bgaster,

    Thank you very much. I can understand.

    But it's not completely.

    If,for example

    (1) 1 PC is connected with 2 graphic cards,NVIDIA and ATI. Both card are available.

    I had thought that this case has 1 host and 1 platform. Then There is 1 platform ID.
    I think the specification says 1 platform has 1 host.
    But I changed my notion, the 'host' is not physical machine.Then this case may have 2 platforms and 2 hosts.

    I have confused, please help.

    allow mutiple vendor implementations to be present on the same machine
    std::cout << " Plaform Vendor:\t\t\t\t "
    << (*i).getInfo<CL_PLATFORM_VENDOR>().c_str() << std::endl;

  4. #4
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: In the case the 2 or more platforms is aviailable

    The OpenCL "platform" is the drivers supplied for the vendor.

    On Mac OS X, there is one platform:
    - Apple's supports AMD GPUs, Nvidia GPUs, and Intel CPUs
    On linux/windows, there are two platforms:
    - Nvidia's supports Nvidia GPUs
    - AMD's supports AMD GPUs and CPUs

    So if you have both Nvidia's and AMD's platform installed (once the platform layer is actually working, which it isn't currently) you should see two platforms. Each platform may have multiple devices. The host is the device that is executing your application. If you are using a CPU device in OpenCL then the CPU is doing both the host work and the OpenCL device work.

  5. #5
    Junior Member
    Join Date
    Oct 2009
    Posts
    7

    Re: In the case the 2 or more platforms is aviailable

    Thank you very much.

    It is difficult to try 2 platform situation for me actually.
    Because of your help, I understood well.

Similar Threads

  1. Do I need atomic_add in that case?
    By linyufly in forum OpenCL
    Replies: 6
    Last Post: 09-10-2012, 02:12 PM
  2. eglCopyBuffers - use case
    By pguza in forum Cross API and window system integration
    Replies: 2
    Last Post: 06-04-2012, 08:49 AM
  3. IN case of OMX_CONF_WaitForResourcesTest
    By jaeryul in forum OpenMAX
    Replies: 1
    Last Post: 01-01-1970, 12:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •