OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

GPU and CPU floating point equivalence

PCox
Beginner
640 Views

We have an algorithm that has been running floating point on CPUs for years, creating images.
We're moving the algorithm onto GPU, but the client strongly insists that the output must be identical between CPU and GPU.
We have fixed point implementations for both CPU and GPU, so we can meet this criteria, however the fixed point introduces small inaccuracies at extreme corner cases, so we would like to avoid using this where possible.
So we would like to know if floating point operations on Intel GPU and Intel CPU will always result in the same floating point output, thus removing the need for the fixed point implementation in all-Intel environments.
Can you tell me whether this assumption is reasonable?

0 Kudos
1 Solution
Jeffrey_M_Intel1
Employee
640 Views

As you know, guaranteeing bit for bit identical results is hard to do across hardware architectures even when hardware instructions conform to the same standards.  Here CPU and GPU have different hardware and different compilers.  You can increase equivalence by making things like type conversions and order of operations explicit in your kernel code.  However, as far as I know there is no way to ensure that all results will be 100% identical across hardware types. 

The compute architecture guide from Steve Junkins is an excellent place to start for information on GPU execution unit architecture:

https://software.intel.com/sites/default/files/managed/c5/9a/The-Compute-Architecture-of-Intel-Processor-Graphics-Gen9-v1d0.pdf

 

View solution in original post

0 Kudos
1 Reply
Jeffrey_M_Intel1
Employee
641 Views

As you know, guaranteeing bit for bit identical results is hard to do across hardware architectures even when hardware instructions conform to the same standards.  Here CPU and GPU have different hardware and different compilers.  You can increase equivalence by making things like type conversions and order of operations explicit in your kernel code.  However, as far as I know there is no way to ensure that all results will be 100% identical across hardware types. 

The compute architecture guide from Steve Junkins is an excellent place to start for information on GPU execution unit architecture:

https://software.intel.com/sites/default/files/managed/c5/9a/The-Compute-Architecture-of-Intel-Processor-Graphics-Gen9-v1d0.pdf

 

0 Kudos
Reply