Use QueryAdapter APIs as per MS directives
authorNikhil Joshi <nikhilj@nvidia.com>
Fri, 12 Jul 2019 10:12:54 +0000 (15:42 +0530)
committerNikhil Joshi <nikhilj@nvidia.com>
Tue, 6 Aug 2019 06:14:59 +0000 (11:44 +0530)
commitebbcd143e92a6e53d773e4a29c9dd691851887f7
treeafcc20d872f9fdec70ea2924aeb3170a1eeea887
parent702226f7477feea40d6b45dffc7b856adc7a4867
Use QueryAdapter APIs as per MS directives

Update ICD loader to use QueryAdapter APIs
as per MS directives for para-virtualization.

This includes changes to -
1. Order OpenCL platforms consistent with Windows adapters,
   to honor user-settings for multi-adapter machines.
2. Fix OS version detection.
3. Some minor fixes including
    1. Add trace prints at required places.
    2. Fix build failure in getting the address of D3DKMTQueryAdapterInfo.
    3. Fix early return platform enumeartion if there are no entries found for old reg key
       under "HKLM\\SOFTWARE\\Khronos\\OpenCL\\Vendors" to allow add for the entries found
       using DXGK interface and HKR entries.
4. Some other fixes including
    1. Update README.md with WDK dependency information.
    2. Move AddAdapter* call inside for which got misplaced while resolving conflicts.
    3. Free WinAdapter allocations and avoid overriding NULL platform.
5. Fixes based on review comments including -
    1. WinAdapter is reallocated with previous allocation freed.
       However, the final allocation is not freed.
       Fixed the same to free at the end of enumeration.
    2. Fix header file ordering by including windows headers
       inside necessary header files.
README.md
loader/icd_dispatch.c
loader/linux/icd_linux.c
loader/windows/icd_windows.c
loader/windows/icd_windows_dxgk.c
loader/windows/icd_windows_hkr.c
loader/windows/icd_windows_hkr.h