A cl_program can have an associated cl_context, which is tied to a specific device. In this case, only building for the devices tied to the cl_context makes sense, and so device list can be left NULL.
cl_program
cl_context
NULL