pocl/pocl — pull request #68 by clementleger (2014-04-09 08:35:09+00:00)
Title: Multidev

This is an attempt to make device probing more flexible. The device related functions have been factorized in devices.c (pocl_device_get_env_count, pocl_get_devices pocl_get_device_type_count).
A probe function has been added to the device operations. This probe function should return the count of probe devices.
basic, pthread, ttasim and cellspu implement it by checking how many times their name is in the env var POCL_DEVICES. This permit backward compatibility with old syntax.
If the env var is not defined (pocl_device_get_env_count return -1) then pthread assume it one instance is present (old behavior).
New device can implement probing by using dedicated librairies for instance.
The parameters for init are still passed using POCL_DEVICEx_PARAMETERS. This should probably be reviewed as order in the env var POCL_DEVICES does not matter anymore and it can led to unexpected device ordering.