## 3 GPU Parallelization of Metaphorless Optimization Algorithms
### GPU-Based Acceleration of the Enhanced Jaya Algorithm
12:endif
13:endfunction
```  
**Algorithm 21** Kernel for permuting the population  
```
1:functionEJAYA-driven_population_update_kernel(\(X\))
2:/*Device code */
3: Determine \(row\) using \(x\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
4: Determine \(col\) using \(y\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
5:if\(row\leq popSize\)and\(col\leq numVar\)then
6:if\(P_{select}[row]=\)'\(LES\)'then
7:\(X^{new}[row,col]\gets X[row,col]+rand()\times(PU[col]-X[row,col])-rand() \times(PL[col]-X[row,col])\);
8:else\(X^{new}[row,col]\gets X[row,col]+randn[row]\times(X^{old}[row,col]-X[row,col])\);
9:endif
10:endif
11:Check_boundary_integrity_function(\(X^{new}\)). 12:endif
13:endfunction
```  
**Algorithm 22** Kernel for permuting the population  
```
1:functionEJAYA-driven_population_update_kernel(\(X\))
2:/*Device code */
4: Determine \(row\) using \(x\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
5: Determine \(col\) using \(y\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
6:if\(row\leq popSize\)and\(col\leq numVar\)then
7:if\(P_{select}[row]=\)'\(LES\)'then
8:\(X^{new}[row,col]\gets X[row,col]+rand()\times(PU[col]-X[row,col])-rand() \times(PL[col]-X[row,col])\);
9:endif
10:endif
11:Check_boundary_integrity_function(\(X^{new}\)). 12:endif
13:endfunction
```  
**Algorithm 23** Kernel for permuting the population  
The function ```
**Algorithm 24** Kernel for permuting the population
```
1:functionEJAYA-driven_population_update_kernel(\(X\))
2:/*Device code */
4: Determine \(row\) using \(x\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
5: Determine \(col\) using \(y\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
6:if\(row\leq popSize\)and\(col\leq numVar\)then
7:if\(P_{select}[row]=\)'\(LES\)'then
8:\(X^{new}[row,col]\gets X[row,col]+rand()\times(PU[col]-X[row,col])-rand() \times(PL[col]-X[row,col])\);
9:\(P_{select}[row,col]+rand()\times(PL[col]-X[row,col])\);
10:endif
11:Check_boundary_integrity_function(\(X^{new}\)). 12:endif
13:endfunction ```
**Algorithm 25** Kernel for permuting the population

The function
```  
**Algorithm 26** Kernel for permuting the population  
```
1:functionEJAYA-driven_population_update_kernel(\(X\))
2:/*Device code */
3: Determine \(row\) using \(x\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
4: Determine \(col\) using \(y\) dimension of \(blockDim\), \(blockIdx\), and \(threadIdx\);
5:if\(row\leq popSize\)and\(col\leq numVar\)then
6:if\(P_{select}[row]=\)'\(LES\)'then
7:\(X^{new}[row,col]\gets X[row,col]+rand()\times(PU[col]-X[row,col])-rand() \times(PL[col]-X[row,col])\);
8:\(P_{select}[row,col]+rand(P_{select}[row,col]+rand(P_{select}[

### GPU-Based Acceleration of the Rao Optimization Algorithms

Algorithm 20 presents a comprehensive characterization of a collective GPU-based parallelization of the three Rao algorithms recently proposed by the authors [37]. This implementation integrates the elementary methods constituting Rao-1, Rao-2, and Rao-3 heuristics into a singular and unified parallelization. ```
1:/*Initialization*/
2:Initialize\(numVar\),popSize and\(maxIter\);\(\triangleright\)Host
3:\(X\leftarrow\textsc{Generate\_initial\_population\_kernel}()\);
4:Evaluate_fitness_values_kernel\((X)\);\(\triangleright\)Host
5:\(i\gets 1\);
6:/*Main loop*/
7:while\(i\leq maxIter\)do\(\triangleright\)Host
8:Determine\(X_{best,i}\) and\(X_{worst,i}\);
9:ifalgorithm\(=\)'Rao-2' or 'Rao-3'then
10:\(t_{i}\leftarrow\textsc{Select\_random\_solutions\_kernel}()\);
11:endif
12:\(X_{i}^{new}\leftarrow\textsc{Rao-driven\_population\_update\_kernel}(X_{i})\);
13:Evaluate_fitness_values_kernel\((X_{i}^{new})\);
14:Greedy_selection_kernel\((X_{i},X_{i}^{new})\);
15:\(i\gets i+1\);
16:endwhile
17:Output the best solution found and terminate.\(\triangleright\)Host and device
```
**Algorithm 20** GPU-based parallel Rao-1, Rao-2, and Rao-3

The three Rao algorithms employ a shared optimization approach, differing primarily in their population update strategies.