|
|
|
@ -8,7 +8,7 @@ __kernel void Cast_fp32_to_fp16(__read_only image2d_t input, __write_only image2
|
|
|
|
|
if (x >= XY.x || y >= XY.y) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
half4 result = convert_half4(READ_IMAGE(input, smp_none, (int2)(x, y)));
|
|
|
|
|
half4 result = convert_half4(read_imagef(input, smp_none, (int2)(x, y)));
|
|
|
|
|
write_imageh(output, (int2)(x, y), result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -18,8 +18,8 @@ __kernel void Cast_fp32_to_fp32(__read_only image2d_t input, __write_only image2
|
|
|
|
|
if (x >= XY.x || y >= XY.y) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
float4 result = READ_IMAGE(input, smp_none, (int2)(x, y));
|
|
|
|
|
write_imageh(output, (int2)(x, y), result);
|
|
|
|
|
float4 result = read_imagef(input, smp_none, (int2)(x, y));
|
|
|
|
|
write_imagef(output, (int2)(x, y), result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__kernel void Cast_fp16_to_fp16(__read_only image2d_t input, __write_only image2d_t output, int2 XY) {
|
|
|
|
@ -28,7 +28,7 @@ __kernel void Cast_fp16_to_fp16(__read_only image2d_t input, __write_only image2
|
|
|
|
|
if (x >= XY.x || y >= XY.y) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
half4 result = READ_IMAGE(input, smp_none, (int2)(x, y));
|
|
|
|
|
half4 result = read_imageh(input, smp_none, (int2)(x, y));
|
|
|
|
|
write_imageh(output, (int2)(x, y), result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -38,6 +38,6 @@ __kernel void Cast_fp16_to_fp32(__read_only image2d_t input, __write_only image2
|
|
|
|
|
if (x >= XY.x || y >= XY.y) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
float4 result = convert_float4(READ_IMAGE(input, smp_none, (int2)(x, y)));
|
|
|
|
|
write_imageh(output, (int2)(x, y), result);
|
|
|
|
|
float4 result = convert_float4(read_imageh(input, smp_none, (int2)(x, y)));
|
|
|
|
|
write_imagef(output, (int2)(x, y), result);
|
|
|
|
|
}
|
|
|
|
|