Open main menu

CDOT Wiki β

Changes

GPU621/Group 5

3,975 bytes added, 18:48, 4 April 2023
no edit summary
== OpenMP ==
Assuming that you’ve already installed the *Intel oneAPI Base & HPC Toolkits*, let’s start with integrating OpenMPinto our workspace. We’ll need to do a couple of things:# Add a Task# Add a Launch# Add the library and bin directory location for intellisense === Tasks ===We’ll add a task to compile our source code using OpenMP, this task will only build the active file using OpenMP.   { "tasks": [ { "type": "cppbuild", "label": "C/C++ using OpenMP: g++ build active file",// Task label we'll reference in launch "command": "/usr/bin/g++", "args": [ "-fdiagnostics-color=always", "-Xpreprocessor", // Identifies we are setting options for preprocessing "-fopenmp", // Preprocessor is set to use OpenMP "-I/usr/local/Cellar/libomp/15.0.7/include", // OpenMP include directory path "-L/usr/local/Cellar/libomp/15.0.7/lib", // OpenMP library directory path "-std=c++11", // C++ language standard to follow "-g", // Enables debugging information "${file}", // Active file being compiled "-o", // Output file "${fileDirname}/${fileBasenameNoExtension}" // Output file path ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "Task generated by User" } ] } === Launch === { "version": "0.2.0", "configurations": [ { "name": "C/C++ using OpenMP: g++ build and debug active file", "type": "cppdbg", // Create for a CPP Debugger "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}", // The program to be debugged. "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], "externalConsole": false, "MIMode": "lldb", "preLaunchTask": "C/C++ using OpenMP: g++ build active file" // Make sure to set this to our task label }, ] } === c_cpp_properties.json ===This file is connected to our C/C++ extension by Microsoft it tells the extension what paths will be included within our compiler, and provides information to intellisense. { "configurations": [ { "name": "Mac", "includePath": [ "${workspaceFolder}/**", // Adds all files within our Current workspace to the Included files "/usr/local/Cellar/libomp/15.0.7/include", // Adds all files within the libomp workspace to the Included files ], "defines": [], "macFrameworkPath": [ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/g++", "cStandard": "c11", // Standard we're using "intelliSenseMode": "macos-clang-x64" } ], "version": 4 }
== TBB ==
24
edits