Results 1 to 6 of 6

Thread: unresolved external symbol clIcdGetPlatformIDsKHR...

  1. #1
    Senior Member
    Join Date
    Mar 2011
    Location
    Seoul
    Posts
    120

    unresolved external symbol clIcdGetPlatformIDsKHR...

    I originally posted this on the AMD OpenCL forum, but since I wasn't getting any replies and this may be more related to a misunderstanding of mine with the OpenCL spec than my usage of the AMD APP SDK, I'm cross posting it here as well.

    I'm trying to experiment using clIcdGetPlatformIDsKHR, but I can't even seem to get my first test code to compile. I'm using the Visual Studio 2010 with the AMD APP SDK 2.6 and Catalyst 12.4--installed after the SDK. I've added $(AMDAPPSDKROOT)include and $(AMDAPPSDKROOT)lib\x86_64 (for x64) to the include and library directories, respectively, and added the OpenCL.lib to the linked libraries. Here's the short source code
    Code :
        #if defined(__APPLE__) || defined(__MACOSX)
        #include <OpenCL/cl.hpp>
        #else
        #include <CL/cl.hpp>
        #endif
     
        int main(int argc, char *argv[])
        {
            cl_int status = CL_SUCCESS;
     
            cl_uint num_platforms = 0;
            cl_platform_id *platforms = NULL;
     
            status |= clIcdGetPlatformIDsKHR(num_platforms, platforms, &num_platforms);
            platforms = new cl_platform_id[num_platforms];
            status |= clIcdGetPlatformIDsKHR(num_platforms, platforms, &num_platforms);
     
            delete [] platforms;
     
            return status;
        }
    and error
    Code :
        error LNK2019: unresolved external symbol clIcdGetPlatformIDsKHR referenced in function main

    Could anyone guess as to what's causing this error and how I could fix it? Thanks!

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    9

    Re: unresolved external symbol clIcdGetPlatformIDsKHR...

    Do you enable cl_khr_icd extension as the documentation note says?

    #pragma OPENCL EXTENSION cl_khr_icd : enable

  3. #3
    Senior Member
    Join Date
    Mar 2011
    Location
    Seoul
    Posts
    120

    Re: unresolved external symbol clIcdGetPlatformIDsKHR...

    Thank you for pointing that out; however I still get the same error even after including that extension enable line at the beginning or end of the header include section.

    Any other suggestions?

  4. #4
    Senior Member
    Join Date
    Aug 2011
    Posts
    271

    Re: unresolved external symbol clIcdGetPlatformIDsKHR...

    Did you check the extension is supported on the given device?

  5. #5
    Senior Member
    Join Date
    Mar 2011
    Location
    Seoul
    Posts
    120

    Re: unresolved external symbol clIcdGetPlatformIDsKHR...

    The platform supports the cl_khr_icd extension, although I don't see it listed under any of the device extensions. Since this function is called on the host side it should work, right?

    Platform Profile: FULL_PROFILE
    Platform Version: OpenCL 1.2 AMD-APP (923.1)
    Platform Name: AMD Accelerated Parallel Processing
    Platform Vendor: Advanced Micro Devices, Inc.
    Platform Extensions: cl_khr_icd cl_amd_event_callback cl_amd_offline_devices cl_khr_d3d10_sharing

  6. #6
    Junior Member
    Join Date
    May 2012
    Posts
    1

    Re: unresolved external symbol clIcdGetPlatformIDsKHR...

    I wanted to bump this thread, as I have the same problem.

    It seems to me that I might be supposed to use clGetExtensionFunctionAddressForPlatform to get a pointer to the actual function, but because that function requires a platform to be passed in, I'm quite confused, since I need clIcdGetPlatformIDsKHR to get all the platform IDs as a starting point.

    Also, I don't think #pragma OPENCL EXTENSION cl_khr_icd : enable would help at all. The way I understand it (from my limited experience with OpenCL and my reading of the specs) that pragma applies to OpenCL C code meant to be compiled and run on the device, not to host code as we are discussing here. However, it is very likely that I may be missing something.

    I must add that my code is already working using clGetPlatformIDs, and my device does support the cl_khr_icd extension. I'm on Windows 7, using VS11 Beta, with AMD APP SDK 2.7.

    Thanks in advance for any help, advice, pointers, etc.!

Similar Threads

  1. Pass symbol definitions with spaces as build options?
    By noah_r in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 4
    Last Post: 04-25-2012, 03:54 PM
  2. clGetGLContextInfoKHR unresolved
    By jstier in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 1
    Last Post: 04-15-2011, 04:07 PM

Posting Permissions

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