casting a uchar1 to a float

I have a situation where I will be getting input data which will always be in the unsigned int range value of 0-32, and is received as a uint8 type(from MATLAB).

I cast it as a uchar1 type in the .cpp for the cudaMemcpy to device memory.

The problem is that when I try to cast a value from that uchar1 array to a float(in a device kernel) for a calculation I get an error along the lines of 'no suitable conversion for those types…".

I am sure there is an easy way to get around this issue, but wanted to check here first.


EDIT: I just realized that I need to use the .x member like this:

uchar1 v;

float t= (float)v.x;

Would there be any problems with that conversion if the v data is always in that range?