Summing array of floats, using OpenCL, fails with accuracy error

cancel
Showing results for 
Search instead for 
Did you mean: 

Summing array of floats, using OpenCL, fails with accuracy error

759 Views
andyp
Contributor II

An OpenCL program, derived from this Apple Developer example: OpenCL Parallel Reduction Example, fails with an accuracy error.

This program uses OpenCL to sum 1,048,576 floating point numbers 1000 times.

The program was run on imx6 quad with the arguments "gpu" and "float".

The imx6 is running Windows CE7 = WEC7 = Windows Embedded Compact 7.

Output:

   Result[0] = 524317.562500 != 524315.912500

   Error: Incorrect results obtained! Max error = 1.750000

 

The same OpenCL program, modified slightly to run on Windows 7/64 PC with an NIVIDIA K600, ran OK with no accuracy errors.

See attachments for the original OpenCL program source and derivatives.

 

The program has not been run on Linux. My hardware does not run Linux.

Original Attachment has been moved to: PC_AddUsingReduction.zip

Original Attachment has been moved to: WEC7_Add_UsingReduction.zip

Original Attachment has been moved to: Original-OpenCL_Parallel_Reduction_Example.zip

Labels (2)
5 Replies

509 Views
andre_silva
NXP Employee
NXP Employee

I will test it on linux soon as possible.

regards,

Andre

0 Kudos

508 Views
andyp
Contributor II

Hello Andre,

Thank you for your email and I look forward to hearing about how well this OpenCL program runs on Linux.

Andy Purcell

Software Engineer, TSO

Keysight Technologies

900 S. Taft Ave

Loveland, CO 80537-6378

970-679-5976 (phone)

970-635-6867 (fax)

0 Kudos

508 Views
andre_silva
NXP Employee
NXP Employee

Hi Andy,

please, find attached the ported code to imx6q sabresd board on Linux (yocto 3.10.53), also here are the results:

----------------------------------------------------------

root@imx6qsabresd:/home/fp_precision_test# ./reduce

----------------------------------------------------------------------

Connecting to Vivante Corporation Vivante OpenCL Device...

----------------------------------------------------------------------

Loading program 'reduce_int_kernel.cl'...

----------------------------------------------------------------------

Pass[  0] Global[4096] Local[  64] Groups[  64] WorkItems[  64] Operations[1] E]

Pass[  1] Global[  32] Local[  32] Groups[  1] WorkItems[  32] Operations[1] E]

----------------------------------------------------------------------

Timing 1000 iterations of reduction with 1048576 elements of type int ...

----------------------------------------------------------------------

----------------------------------------------------------------------

Results Validated!

----------------------------------------------------------------------

root@imx6qsabresd:/home/fp_precision_test#

----------------------------------------------------------

Regards,

Andre

508 Views
andre_silva
NXP Employee
NXP Employee

Hi Andy,

I am going to check that and let you know soon as possible.

regards,

Andre

0 Kudos

508 Views
Yuri
NXP TechSupport
NXP TechSupport

  Freescale does not support WinCE BSP for i.MX6.

Please apply to Adeneo.

Reference BSPs for Freescale i.MX6 SABRE LITE, SABRE SDB and SABRE SDP

Adeneo Embedded continues its commitment to support Freescale's i.MX roadmap


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos