Results 1 to 2 of 2

Thread: clBuildProgram failed

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    23

    clBuildProgram failed

    Hello

    I have worked little bit in OpenCL now but recently "clBuildProgram" failed in one of my program. My code excerpt is below:


    cl_program program;
    program = clCreateProgramWithSource(context, 1, (const char**) &kernel_string, NULL, &err);
    if(err != CL_SUCCESS)
    {
    cout<<"Unable to create Program Object. Error code = "<<err<<endl;
    exit(1);
    }
    if(clBuildProgram(program, 0, NULL, NULL, NULL, NULL) != CL_SUCCESS)
    {
    cout<<"Program Build failed\n";
    size_t length;
    char buffer[2048];
    clGetProgramBuildInfo(program, device_id[0], CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, &length);
    cout<<"--- Build log ---\n "<<buffer<<endl;
    exit(1);
    }

    Normally earlier I got syntax or other errors inside kernel file here with the help of "clGetProgramBuildInfo()" function whenever "clBuildProgram" Failed but when this program runs, on console it only prints:

    Program Build failed
    --- Build log ---
    <Nothing here>

    What can be the problem with my kernel file that I dont get any build fail information ?

  2. #2
    Junior Member
    Join Date
    Jul 2011
    Posts
    23

    Re: clBuildProgram failed

    And when I tried to print the error code returned by "clBuildProgram"; it is "-11"......

Similar Threads

  1. Failed to get PlatformID
    By CedricW in forum OpenCL
    Replies: 1
    Last Post: 08-02-2012, 02:13 PM
  2. Failed to build
    By SAdam in forum OpenCL
    Replies: 1
    Last Post: 12-15-2011, 03:04 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
  •