PDA

View Full Version : Spec confusion regarding convert_ functions



himanshugautam
09-19-2013, 02:15 AM
Refer OpenCL Spec 1.2

Section 6.2.3
Explicit conversions may be performed using the
convert_destType(sourceType)
suite of functions. These provide a full set of type conversions between supported types (see
sections 6.1.1, 6.1.2 and 6.1.3) except for the following types: bool, half, size_t,
ptrdiff_t, intptr_t, uintptr_t, and void

Section 6.2.3.1
Conversions are available for the following scalar types: char, uchar, short, ushort,
int, uint, long, ulong, float, and built-in vector types derived therefrom.

There are datatypes like
double,
image2d_t
image3d_t
image2d_array_t
image1d_t
image1d_buffer_t
image1d_array_t
sampler_t
event_t
Which are covered in section 6.2.3, but not in 6.2.3.1. What is expected of these datatypes?

utnapishtim
09-30-2013, 02:07 AM
double is handled like float.

The other data types (image, sampler, event) are neither scalar types nor vector types, so section 6.2.3.1 does not apply to them.
They can't be cast to another type. They are simply considered opaque types.