Hi !
I am having quite a strange problem on the cpu ( I don't have intel gpu to try this, but works on nvidia ).
I have a kernel which makes everything crash at an assignment depending on my structure.
If I uncomment the _pad0 variable the crash does not appear. The sizes are the same on the host and device.
Here is my structure:
typedef struct capsule_s { vector2d_t p; // center of mass position vector2d_t v; // center of mass velocity scalar_t r; // Radius scalar_t mass_density; scalar_t color_field; //scalar_t _pad0; // For removing the crash with intel cpu. } capsule_t;
vector2d_t is defined as cl_float2 for host and float2 in kernels. scalar_t as cl_float and float.
In the kernel I have something similar to:
capsule_t geom_old = in_capsules[idx]; /* Code that doesn't crash. */ out_capsules[idx] = geom_new; // Here it crashes
More precisely I found that all of this fail :
out_capsules[idx].v = geom_new.v; // fails /---------- float2 tmp = geom_new.v; // no failure here. out_capsules[idx].v = tmp; // fails /---------- out_capsules[idx].v.x = geom_new.v.x; // fails
And this only happens for this member. I am not sure if this is related to alignement since other members assignments do not cause problems.
Any help is welcome :)
Thanks in advance !