aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-10-12 11:05:18 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit43fc5cd712eed23b9cec340f526e6d5fb5050afa (patch)
treef7570a93ab265d1bb6ed24a0407bab3834ee14f5 /src
parent3c5b4ff4a803fcdb0eeca1c0e24f65a3bd0563b7 (diff)
downloadComputeLibrary-43fc5cd712eed23b9cec340f526e6d5fb5050afa.tar.gz
COMPMID-618: Fix mismatches in CLDepthConvert Oclgrind
Out-of-bounds float to integer conversion is implementation defined. Oclgrind converts to S32 and truncated while GPU converts S32 and clamps. We force to always SATURATE for float to int conversion. Change-Id: I82be9e8cdcc49b32adb8c0da064542b63f891666 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/91512 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/CL/kernels/CLDepthConvertKernel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/CL/kernels/CLDepthConvertKernel.cpp b/src/core/CL/kernels/CLDepthConvertKernel.cpp
index c43884a509..b2132073d5 100644
--- a/src/core/CL/kernels/CLDepthConvertKernel.cpp
+++ b/src/core/CL/kernels/CLDepthConvertKernel.cpp
@@ -90,7 +90,8 @@ void CLDepthConvertKernel::configure(const ICLTensor *input, ICLTensor *output,
if(input_size > output_size)
{
kernel_name += "_down";
- build_opts.insert((policy == ConvertPolicy::WRAP) ? "-DWRAP" : "-DSATURATE");
+ // Down conversions from float always SATURATE as out-of-bounds conversion from float->integer is implementation defined
+ build_opts.insert(((policy == ConvertPolicy::WRAP) && !is_data_type_float(input->info()->data_type())) ? "-DWRAP" : "-DSATURATE");
}
else
{