# Parallel Simulations of the Sharp Wave-Ripples of the Hippocamp on Multicore CPUs and GPUs
## 3 Experimental Results
### Experimental Setup  
All the serial and parallel codes described in the previous section have been developed using the Microsoft Visual Studio 2022 Integrated Development Environment (IDE). For the serial and OpenMP codes, the compiler flags have been carefully configured to achieve the best performance in terms of processing speed. Optimisation has been set to maximise speed (_O_2), enabling a range of optimisations such as inline expansion and loop unrolling that prioritise execution speed. To further improve performance, inline Function Expansion (_Ob_2) was enabled, allowing the compiler to inline functions wherever beneficial, reducing the overhead associated with function calls. To take advantage of processor-specific capabilities, the Enhanced Instruction Set has been configured to use Advanced Vector Extensions (AVX), allowing the use of SIMD instructions that accelerate data processing tasks. In addition, the floating-point model has been set to Fast (_/fp_), which allows aggressive floating-point optimisations that improve speed, albeit with a slight trade-off in accuracy. For parallel OpenMP code, OpenMP support (_/openmp_) was enabled, allowing the compiler to recognise and efficiently handle OpenMP directives, thereby optimising the parallel parts of the code. To further maximise the performance of the whole program, program optimisation (_/GL_) was enabled, which facilitates link-time code generation (LTCG), enabling cross-module optimisation to optimise the program as a whole rather than in isolated sections. Finally, Link Time Code Generation (_/LTCG_) was used in the linking phase to ensure that the linker performs optimisations across module boundaries, further improving execution speed. By carefully configuring these compiler flags, the project exploits the full potential of the hardware, ensuring that both serial and parallel code paths are optimised for maximum processing speed, ultimately resulting in superior execution performance. Concerning the CUDA code, to ensure the best performance targeting both the NVIDIA A16 and RTX 4090 GPUs, the compiler flags and settings have been carefully configured to optimise processing speed. Compute Capability was set according to the target GPU architecture. For the A16, based on the Ampere architecture, and the RTX 4090, based on the Ada Lovelace architecture, the _-arch=compute_80_ flag was used for the A16 and _-arch=compute_89_ for the RTX 4090. These flags ensure that the compiled code takes full advantage of the specific architectural features and instructions available on these GPUs. To further optimise performance, the Fast Math option (_-use_fast_math_) was enabled. This setting allows the CUDA compiler to use faster, less precise math operations, which can significantly improve performance in scenarios where a slight reduction in precision is acceptable. Parallel Thread Execution (PTX) optimisations have been fine-tuned by enabling link-time optimisations (_-dllo_). This allows the compiler to optimise across multiple files and modules, ensuring the final executable is as efficient as possible, especially for large, complex CUDA projects. Finally, memory transfers between the host and device have been streamlined by enabling asynchronous transfers using streams and setting the _-Xytras \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature** & **NVIDIA A16** & **NVIDIA RTX 4090** \\ \hline Architecture & Ampere & Ada Lovelace \\ \# CUDA cores & 7168 total, 1792 per GPU & 16,484 \\ RAM [GB] & 64 total, 16 per GPU & 24 \\ Memory bandwidth [Gb/s] & 320 & 1008 \\ Thermal Design Power [W] & 250 & 450 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Hardware features of the two adopted GPUs. -dlcm=ca_ flag to cache global loads in L1, which is critical to minimising data transfer overhead, especially in high throughput applications. By carefully configuring these compiler flags and optimisations, CUDA code is fine-tuned to take full advantage of the NVIDIA A16 and RTX 4090 GPUs.