Results 1 to 2 of 2

Thread: Execution Error - clGetProgramInfo with CL_PROGRAM_BINARIES

  1. #1

    Execution Error - clGetProgramInfo with CL_PROGRAM_BINARIES

    Hi,
    I tried get the binnary of my kernel, but when i run the code below a execution error occours in the line: errcode = clGetProgramInfo(program, CL_PROGRAM_BINARIES, binary_sizes[0]*sizeof(size_t), binary,&quantidadecopiadaparamvalue);


    //Compilação do Kernel.
    cl_int erro_compila_kernel = clBuildProgram(program, 1, &device, header_opcao, NULL, NULL);

    //**************
    size_t number_of_binaries;
    size_t quantidadecopiadaparamvalue;
    cl_uint num_dispositivos;
    int errcode = clGetProgramInfo(program, CL_PROGRAM_NUM_DEVICES, sizeof(cl_uint), &num_dispositivos, NULL);


    if( errcode == CL_SUCCESS )
    cout << "\nA quantidade de dispositivos é: " << num_dispositivos;
    else
    cout << "\nNão foi possível retornar a quantidade de dispositivos.";

    size_t *binary_sizes = (size_t *) malloc(num_dispositivos * sizeof(size_t));


    errcode = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES,num_dispositivos * sizeof(size_t), binary_sizes, NULL);

    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));
    }


    errcode = clGetProgramInfo(program, CL_PROGRAM_BINARIES, binary_sizes[0]*sizeof(size_t), binary,&quantidadecopiadaparamvalue); //Here is where the error occurs


    Very thanks,

  2. #2

    Re: Execution Error - clGetProgramInfo with CL_PROGRAM_BINA

    Hi,

    No one knows?
    I really need to solve that.
    I know that is boring analyse code, but if someone can help, i will be grateful a lot.

Similar Threads

  1. Constant memory execution error
    By samuelbferraz in forum OpenCL
    Replies: 4
    Last Post: 01-20-2011, 06:09 PM
  2. error after execution
    By dollarzuke in forum OpenCL
    Replies: 0
    Last Post: 04-22-2010, 12:02 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
  •