Results 1 to 7 of 7

Thread: Get binary of kernel - clGetProgramInfo

  1. #1

    Get binary of kernel - clGetProgramInfo

    Hi,

    thank anyone who can help me.

    I need that my code run without be compiled in execution time.

    When i run the host code, in this line a error of access in memory occurs.

    errcode = clGetProgramInfo(program, CL_PROGRAM_BINARIES, binary_sizes[0] * sizeof(size_t), teste_aloprado,&quantidadecopiadaparamvalue);

    The all code of that i tried follows:

    errcode = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES,num_dispositivos * sizeof(size_t), binary_sizes, &quantidadecopiadaparamvalue);
    cout << "\nForam copiados: " << quantidadecopiadaparamvalue << "\n";

    if( errcode == CL_SUCCESS )
    cout << "\nA quantidade de Bytes é: " << binary_sizes[0];
    else
    cout << "\nNão retornou a quantidade de bytes.";




    char **binary = (char **) malloc(num_dispositivos * sizeof(char*));
    for(int i = 0; i < num_dispositivos; i++ )
    {
    binary[i] = (char *) malloc(binary_sizes[i] * sizeof(char));
    }
    //binary_sizes[0]*sizeof(char)
    size_t *teste_aloprado = (size_t *) malloc(binary_sizes[0] * sizeof(size_t));
    errcode = clGetProgramInfo(program, CL_PROGRAM_BINARIES, binary_sizes[0] * sizeof(size_t), teste_aloprado,&quantidadecopiadaparamvalue);

  2. #2

    Re: Get binary of kernel - clGetProgramInfo

    No one know how to help me?

  3. #3

    Re: Get binary of kernel - clGetProgramInfo

    It would help if you posted the actual error code returned, but it looks like you're passing the wrong arguments. You should be passing binary rather than teste_aloprado, and the size should I think be num_dispositivos * sizeof(unsigned char *).

    Technically each time you've used char it should be unsigned char, but in reality I don't think it'll make much difference.

    I've written a tool that does this extraction, which you can see at http://gitorious.org/onlineclc/onlinecl ... nlineclc.c. It only handles one device, but it might still be useful as sample code.

  4. #4

    Re: Get binary of kernel - clGetProgramInfo

    Very Thanks,


    Works fine now

  5. #5

    Re: Get binary of kernel - clGetProgramInfo

    Hi,

    I succeeded get binary and save in a file.

    But, in clgetprogramwithbinary and in
    sivia = clCreateKernel(program,"sivia",&erro_create_kernel ); ,
    no error occurs, but when i call to run kernel the error below occurs:


    Kernel Sivia deu zebra! -48
    ***
    -48
    ***
    Identificacao do erro: CL_INVALID_KERNEL - -48
    Error: Runtime failed to load kernels from OCL binary!

    Very Thanks,

    Luiz.

  6. #6

    Re: Get binary of kernel - clGetProgramInfo

    I realized that i made a mistake.

    At first it seems that i caught the binary and put in a file, and after load in a buffer.

    When i loaded and made the program object with the binary with clCreateProgramWithBinary no error occurs, but in clCreateKernel(program,"sivia",&erro_create_kernel );

    CL_INVALID_KERNEL occurs.

    Very Thanks for help

  7. #7

    Re: Get binary of kernel - clGetProgramInfo

    bmerry or other person that can help, what's happening with code?

Similar Threads

  1. Replies: 1
    Last Post: 05-07-2012, 12:14 PM
  2. Replies: 1
    Last Post: 04-21-2012, 04:15 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
  •