Abstract
We present a symbolic execution-based technique for cross-checking programs accelerated using SIMD or OpenCL against an unaccelerated version, as well as a technique for detecting data races in OpenCL programs. Our techniques are implemented in KLEE-CL, a tool based on the symbolic execution engine KLEE that supports symbolic reasoning on the equivalence between expressions involving both integer and floating-point operations. While the current generation of constraint solvers provide effective support for integer arithmetic, the situation is different for floating-point arithmetic, due to the complexity inherent in such computations. The key insight behind our approach is that floating-point values are only reliably equal if they are essentially built by the same operations. This allows us to use an algorithm based on symbolic expression matching augmented with canonicalisation rules to determine path equivalence. Under symbolic execution, we have to verify equivalence along every feasible control-flow path. We reduce the branching factor of this process by aggressively merging conditionals, if-converting branches into select operations via an aggressive phi-node folding transformation. To support the Intel Streaming SIMD Extension (SSE) instruction set, we lower SSE instructions to equivalent generic vector operations, which in turn are interpreted in terms of primitive integer and floating-point operations. To support OpenCL programs, we symbolically model the OpenCL environment using an OpenCL runtime library targeted to symbolic execution. We detect data races by keeping track of all memory accesses using a memory log, and reporting a race whenever we detect that two accesses conflict. By representing the memory log symbolically, we are also able to detect races associated with symbolically-indexed accesses of memory objects. We used KLEE-CL to prove the bounded equivalence between scalar and data-parallel versions of floating-point programs and find a number of issues in a variety of open source projects that use SSE and OpenCL, including mismatches between implementations, memory errors, race conditions and a compiler bug.
Highlights
RECENT years have seen the emergence of a number of programming models that improve program performance by exploiting data-level parallelism
We evaluated our techniques on a set of benchmarks that compare serial and data-parallel variants of code developed independently by third parties
8.1 Streaming single instruction multiple data (SIMD) Extensions (SSE) Acceleration in OpenCV We evaluated a selection of computer vision algorithms from OpenCV 2.1.0, a popular C++ open source computer vision library initially developed by Intel, and by Willow Garage
Summary
RECENT years have seen the emergence of a number of programming models that improve program performance by exploiting data-level parallelism. Such models include single instruction multiple data (SIMD) and general purpose graphics processing unit (GPGPU) computing, sometimes called single instruction multiple threads (SIMT). IEEE 754 contains support for the representation of zeros (both positive and negative—while negative zero is not a real number, it may be obtained, for example, by multiplying a negative number by zero), infinities (both positive and negative), NaNs (i.e., uncomputable results) and denormalised numbers, which are used to represent small numbers: for single precision, multiples of 2À149 between À2À126 (exclusive) and À2À149 (inclusive), and between 2À149 (inclusive) and 2À126 (exclusive) and for double precision, multiples of 2À1;074 between À2À1;022 (exclusive) and À2À1;074 (inclusive), and between 2À1;074 (inclusive) and 2À1;022 (exclusive). In one experiment [53], a speedup of up to 5.5Â has been observed for SIMD versions of various signal processing and multimedia algorithms on a three-way superscalar out-of-order execution machine resembling the Intel Pentium II
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.