# Acceleration of Particle Swarm Optimization with AVX Instructions
## 1 Introduction  
Intel's AVX (Advanced Vector Extension) utilizes parallel processing of single instructions on several data streams. It was developed to simplify and increase the efficiency of algorithms such as matrix multiplication. This allows the CPU architecture to adapt to more complex problems where the classical approach becomes slow.  
A fair comparison of code performance is hard for the same programs, especially for different architectures or compilers. Generally, the only objective metric available is the execution time, and most authors have adopted this approach [1; 2; 3; 4; 5]. The speedup in execution time is also one of the main reasons for developing a parallel version of an algorithm.  
Most papers focused on parallelization speedup compare highly parallel GPU versions of algorithms with single-core scalar CPU versions. However, this may lead to a misleading interpretation of the GPU vastly outperforming the CPU version. However, the modern CPU multicore architecture with SIMD (single instruction multiple data) instructions reduces the performance gap between GPUs and CPUs.  
In recent years, SIMD has been adopted in various fields--image processing, signal processing, cryptography, machine learning, etc. The impact of AVX on 3D collision modeling was examined by the authors of [6]. The use of AVX in data science, computational statistics and high-performance computation was studied by the authors of [7; 8]. They investigated various vectorization options and available compilers to investigate the impacts on the performances of different algorithms. The authors of [9] explored the optimization of matrix multiplication. The other general concept is sorting, a fast vectorized implementation presented in the paper [10].  
The vector instruction helps to optimize cryptography too. The authors of [11] used AVX to optimize shuffling in the diffusion layer used in block ciphers. AVX-512 wasdeployed in the SIKE cryptosystem to minimize the latency in the key encapsulation mechanism, arithmetics and isogeny computation.  
Related research aims at improving the performance of machine learning. AVX-512 was deployed to enhance deep learning in [12]. The study compares the performance of learning using a GPU and a CPU with AVX. The authors of [13] experimented with AVX for genetic programming, especially with generations of binary trees. AVX allowed them to execute faster and far longer than previous attempts. Another study aimed at improving graph partitioning problems [14].  
This paper compares computing performances obtained by CPU-based parallelized versions of PSO. We have a scalar version of the PSO algorithm, allowing us to run the program with virtually any size of the swarm. We developed parallel versions of this scalar PSO with an internal structure optimized for SIMD instructions. As final implementations share similar limitations, we could compare the actual performances with different designs.  
Our paper presents the novelty of comparing various options of vectorized PSO algorithms. The motivation was to compare the variants for the specific task of PSO. The results presented in this paper could guide other authors and ease the task of selecting the proper vectorization method for faster development and more efficient code.  
We obtained all results on a suite of standard benchmark functions used for single-objective stochastic optimization algorithms. The paper is organized as follows: Section 2 provides relevant background on the PSO algorithm and its parallel implementation with SIMD instructions. We present our experiment design, benchmark test functions and evaluation of results in Section 3. In the last Section 4, we offer conclusions and future outlines.