clCreateProgramWithBinary binaries per Device ?
I'm stuck with a question on "clCreateProgramWithBinary", the standard API call expects a pointer to a binary for each device "listed".
Now, assume I have 10 devices of the same type (let's say all the same GPU) which were all listed when creating the context, I assume the binaries for all the listed devices will be the same, correct?
Should I then pass a pointer to the binary for each device separately (which in that case will end up being the same pointer 10 times), or can I just specify the binary for a single device and assume the kernel will be executed on any of the compatible devices listed in "context" rather than the single one listed in the "program"
Also, assume I then call
clGetProgramInfo( ... CL_PROGRAM_BINARIES ...)
What will happen:
a) Am I now expected to allocate 10x the memory to hold repetitive copies of the same binary (assuming I originally passed the same pointer 10 times)
b) Is the runtime somehow expected to be smarter in such it will acknowledge the fact the binaries are the same for each device
As specific question for runtime-developers:
How do you store the binary internally? Do you keep a copy of the binary per device, or do you keep a copy per device type.
Tags for this Thread