Changes

Jump to: navigation, search

GPU621/Debugging OpenMP

852 bytes added, 21:51, 29 November 2022
Walkthrough
= Walkthrough =
// TODO: Step-by-step walkthrough on how to debug program with the specific window
=== Environment === ==== IDE ==== * Microsoft Visual Studio 2019 ==== Compiler ==== * Intel oneAPI DPC++/C++  === Sample Code === <syntaxhighlight lang="cpp">#include <stdio.h>#include <omp.h> int main(int argc, char** argv) { int partial_Sum, total_Sum; #pragma omp parallel private(partial_Sum) shared(total_Sum) { partial_Sum = 0; total_Sum = 0; #pragma omp for { for (int i = 1; i <= 1000; i++) { partial_Sum += i; } }  //Create thread safe region.#pragma omp critical { //add each threads partial sum to the total sum total_Sum += partial_Sum; } } printf("Total Sum : % d\n", total_Sum); return 0;}</ use same syntaxhighlight>  === Configuration === Enable OpenMP for the current project file '''Project''' - '''Property''' - '''C/C++''' - '''Language [Intel C++]''' - '''OpenMP Support''' - '''Generate Parallel Code (/Qiopenmp)''' [[File: config.png]]  === Output === * The output of the sample program for both tests
// can probably just take something from course notes and modify it to fit our parameters
== Case A: Using the Thread Window ==
24
edits

Navigation menu