Khronos Public Bugzilla
Bug 412 - typedef cl_float4 cl_float3; in cl_platform.h
Summary: typedef cl_float4 cl_float3; in cl_platform.h
Status: NEW
Alias: None
Product: OpenCL
Classification: Unclassified
Component: Header Files (show other bugs)
Version: 1.1
Hardware: All All
: P3 critical
Target Milestone: ---
Assignee: Aaftab Munshi
QA Contact: OpenCL Working Group
Depends on:
Reported: 2011-01-16 19:22 PST by Andrey
Modified: 2016-03-13 20:51 PDT (History)
1 user (show)

See Also:


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;

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).