Community
cancel
Showing results for 
Search instead for 
Did you mean: 
PCox
Beginner
51 Views

GPU and CPU floating point equivalence

Jump to solution

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

Accepted Solutions
Jeffrey_M_Intel1
Employee
51 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-Proce...

 

View solution in original post

1 Reply
Jeffrey_M_Intel1
Employee
52 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-Proce...

 

View solution in original post