mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Fixes several compile issues I am seeing for my version of Visual Studio related to an ambiguous call to `fpclassify`, which is called by `isnan` and other similar functions, specifically for the `cl_half` type: ``` 19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(401,1): error C2668: 'fpclassify': ambiguous call to overloaded function 19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(298,31): message : could be 'int fpclassify(long double) throw()' 19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(293,31): message : or 'int fpclassify(double) throw()' 19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(288,31): message : or 'int fpclassify(float) throw()' 19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(401,1): message : while trying to match the argument list '(_Ty)' ``` Some of these issues seem like differences in compiler behavior, but at least one appears to have identified a legitimate bug. Specifically, this change: * Removes the special-case checks for finite half numbers for commonfns, since this is already handled by `UlpFn`. (test with: `test_commonfns degrees radians`) * Assigns to temporary variables to eliminate the ambiguous function call for relationals. (test with: `test_relationals relational*`) * Properly converts from half to float when checking for NaNs for select. This is the one that seems like a legitimate bug. (test with: `test_select select_half_ushort select_half_short`) * Uses `std::enable_if` to disambiguate a function call for spirv_new. (test with: `test_spirv_new decorate_saturated*`) If it's helpful, my specific Visual Studio version is: ``` Microsoft Visual Studio Professional 2019 Version 16.11.20 VisualStudio.16.Release/16.11.20+32929.386 ``` I also have the Windows Software Development Kit 10.0.19041.685 installed.
test_conformance/spirv_new README ================================== The text versions of the spirv files are present in `conformance-tests/test_conformance/spriv_new/spirv_asm`. These text files have been used to generate the binaries in `spirv_bin` using the assembler from `spirv-tools`. The absolute path to `spirv_bin` needs to be passed after `--spirv-binaries-path` token for the test to find the SPIRV binaries. An example invocation looks like the following: ``` ./test_conformance/spirv_new/test_conformance_spirv_new --spirv-binaries-path /home/user/workspace/conformance-tests/test_conformance/spirv_new/spirv_bin/ [other options] ```