KhronosGroup / KhronosGroup/OpenCL-Docs
Clarification of allowed gentypes for half_ functions
- Dominant language
- Python
- Stars
- 420
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
Hello,
I've recently been generating some dummy kernels for trying various things and after trying them out on few platforms I found that according to the [documentation](https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/tan.html), this CL kernel should at least compile:
``` opencl
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
__kernel void test_kernel(__global half2 *a, __global half2 *b)
{
const int idx = get_global_id(0);
a[idx] = half_tan(b[idx]);
}
```
(Note that the documentation states: "If extended with cl_khr_fp16, generic type name gentype may indicate half and half{2|4|8|16} as arguments and return values.")
However, all compilers I've tried it on so far rejects it and after double checking against the specification rather than the documentation, I cannot find any note that actually allows `half` types for these functions.
Is this use of the `half_`-functions actually correct, or is it simply a bug in the documentation for these functions?
Contributor guide
Research direction
Start with the linked Khronos tan documentation and the relevant OpenCL specification text for half_tan and gentype. Compare whether cl_khr_fp16 permits half arguments and return values, then document the clarification by aligning the reference documentation with the specification or explaining the discrepancy.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100