Khronos Public Bugzilla
Bug 412 - typedef cl_float4 cl_float3; in cl_platform.h
typedef cl_float4 cl_float3; in cl_platform.h
Status: NEW
Product: OpenCL
Classification: Unclassified
Component: Header Files
1.1
All All
: P3 critical
: ---
Assigned To: Aaftab Munshi
OpenCL Working Group
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-16 19:22 PST by Andrey
Modified: 2011-01-17 13:14 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2011-01-16 19:22:58 PST
I've found follow text in cl_platform.h  OpenCL 1.1 header file.
typedef cl_float4 cl_float3; 
IHMO this can leads to uncaught errors in case 

cl_float3 f;
f.w=1.0f;

and some difficulties in case of function overloading.
Comment 1 Ian Ollmann 2011-01-17 13:14:39 PST
The f.w = 1.0f doesn't bother me.  float3 is for most intents and purposes float4, and a way to access the .w storage component is legitimately useful to avoid floating point stalls due to arithmetic done by the host vector unit on uninitialized data in the fourth element.  

However, the declarations of float3 and float4 should be different enough that function overloading works properly. A host side dot(float3, float3) should do different things than a host side dot( float4, float4).