OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

Compiled binaries

janez-makovsek
New Contributor I
224 Views
Hi!

Saving compiled binaries does not seem to work with the current build of Intel Open CL drivers. It appears the driver stores the source files (if judging by the size). Is this as designed? Are there any changes planned in the future?

Thanks!
Atmapuri
0 Kudos
4 Replies
Evgeny_F_Intel
Employee
224 Views
Hi,

Can you post the code you are using to query the binaries?

Also please attach the binary queried with the CL_PROGRAM_BINARIES?

Thanks,
Evgeny
janez-makovsek
New Contributor I
224 Views
Dear Evgeny,

The source is big and not in C++. I can only confirm that the same code which correctly loads AMD CPU, AMD GPU, and NVidia GPU binaries recompiles the source code for Intel Open CL on every run. The only thing I change is the device number on the input.

Do you maybe have some sample C++ code which works for this? Then I can go backward and see what the trick is.

I have attached the binary. I double checked that this binary is not recreated between runs. It always loads the same, but building the program takes the same as if though it is making a full compile. I dont separately specify the soruce code anywhere and the result is a functioning code. Next to that the size of binary is 6x less than what AMD is producing. All this leads me think that the binary does not contain compiled code but rather only compressed source of some kind.

Thanks!
Atmapuri
Evgeny_F_Intel
Employee
224 Views
Hi,

The file you attached is binary that could be used in clCreateProgramWithBinary.

The C++ code for retriving the binary should look like that:

[cpp]size_t binarySizeRet = 0;

size_t binarySize = {0};

unsigned char *binary = NULL;

cl_int iRes = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t), &binarySize, &binarySizeRet);

binary = new unsigned char[binarySize];

clGetProgramInfo(program, CL_PROGRAM_BINARIES, sizeof(unsigned char*), &binary, NULL);
[/cpp]


Evgeny

janez-makovsek
New Contributor I
224 Views
Hi!

Ok, if this is binary then load times are about as long as if compiling the source code. But only with Intel driver. After I loaded and created the program with binary, I also cal clBuildProgram on the created program. This seems to be required for the program to work with AMD drivers. Should that be OK or what else could be the cause of slowness?

Thanks!
Atmapuri
Reply