cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sajis997
Adept I

cast between the scalar and vector types

Hello forum,


I created a buffer of cl_host2 and sent to the kernel as float2. Is it possible to cast it to float inside the kernel as follows:


float *converted = (float*)(original_float2);




Thanks

0 Likes
1 Reply
roger512
Adept II

this should work :

float2 original_float2;

float *converted = (float*)&original_float2;

float x = converted[0];

float y = converted[1];



0 Likes