- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OpenCL 1.2.
I have this struct on host side
typedef struct OCLCamData { cl_int id; cl_float3 position; cl_float3 direction; cl_float max_possible_angle; OCLCamData(): id(0), position(), direction(), max_possible_angle(0) {} OCLCamData(int id_, Point3f position_, Point3f direction_, float max_possible_angle_): id(id_), max_possible_angle(max_possible_angle_) { position.x = position_.x; position.y = position_.y; position.z = position_.z; position.w = -1; direction.x = direction_.x; direction.y = direction_.y; direction.z = direction_.z; direction.w = -1; } } OCLCamData;
In kernel code I've declared it this way
typedef struct CamData { int id; float3 position; float3 direction; float max_possible_angle; } CamData;
Running my code on Intel Core i5 I found that values inside float3 are revesed, so
CamData.position.x == OCLCamData.position.w.
for example
Any ideas?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After removing float3 on host & device sides all works well
typedef struct CamData { int id; float position_x, position_y, position_z; float direction_x, direction_y, direction_z; float max_possible_angle; } CamData;

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page