-
Notifications
You must be signed in to change notification settings - Fork 734
Add vtune and advisor sample #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7482e56
Adding Advisor sample
47bc84c
Adding VTune sample
36926f5
New styl
096352d
New style
2cb99e9
New style
8a837c7
Fix
9862975
Remove chrono
4d86a15
Remove date
cd3d734
Remove date
407cf9a
Fix
ce9ad28
Remove chrono
c5eedc8
New style
eef2819
Fix
1984acd
Fix
ffaec99
iFix
72f0158
iFixi
b898b0b
iFix
2f9fb02
Fix
d8c8314
Fix
3837b22
Fix
21a8370
Add comment
8c1df1f
Add comment
ae8c91e
Update sample.json
JoeOster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Code Samples of Intel(R) Advisor | ||
|
||
| Code sample name | Supported Intel(r) Architecture(s) | Description | ||
|:--- |:--- |:--- | ||
| matrix_multiply | GPU, CPU | Simple matrix multiplication program | ||
|
||
|
||
## License | ||
The code samples are licensed under MIT license |
Empty file.
77 changes: 77 additions & 0 deletions
77
Tools/Advisor/matrix_multiply_advisor/Advisor_matrix_multiply_advisor_README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Matrix Multiply Sample | ||
A sample containing multiple implementations of matrix multiplication. This sample code is implemented using DPC++ language for CPU and GPU. | ||
|
||
| Optimized for | Description | ||
|:--- |:--- | ||
| OS | Linux Ubuntu 18.04; Windows 10 | ||
| Hardware | Kaby Lake with GEN9 or newer | ||
| Software | Intel(R) oneAPI DPC++ Compiler (beta); Intel(R) Advisor | ||
| What you will learn | How to profile an application using Intel(R) Advisor | ||
| Time to complete | 15 minutes | ||
|
||
## Purpose | ||
|
||
The Matrix Multiplication sample performs basic matrix multiplication. Three version are provided that use different features of DPC++. | ||
|
||
## Key Implementation details | ||
|
||
The basic DPC++ implementation explained in the code includes device selector, buffer, accessor, kernel, and command groups. | ||
|
||
## License | ||
This code sample is licensed under MIT license | ||
|
||
## How to Build | ||
|
||
This sample contains 3 version of matrix multiplication using DPC++: | ||
|
||
multiply1 – basic implementation of matrix multiply using DPC++ | ||
multiply1_1 – basic implementation that replaces the buffer store with a local accessor “acc” to reduce memory traffic | ||
multiply1_2 – basic implementation plus the local accessor and matrix tiling | ||
|
||
Edit the line in multiply.h to select the version of the multiply function: | ||
#define MULTIPLY multiply1 | ||
|
||
|
||
### On a Linux* System | ||
To build DPC++ version: | ||
cd <sample dir> | ||
cmake . | ||
make | ||
|
||
Clean the program | ||
make clean | ||
|
||
### On a Windows* System Using Visual Studio 2017 or newer | ||
* Open Visual Studio 2017 | ||
* Select Menu "File > Open > Project/Solution", find "matrix_multiply" folder and select "matrix_multiply.sln" | ||
* Select Menu "Project > Build" to build the selected configuration | ||
* Select Menu "Debug > Start Without Debugging" to run the program | ||
|
||
### on Windows - command line - Build the program using MSBuild | ||
DPCPP Configurations: | ||
Release - MSBuild matrix_multiply.sln /t:Rebuild /p:Configuration="Release" | ||
Debug - MSBuild matrix_multiply.sln /t:Rebuild /p:Configuration="Debug" | ||
|
||
|
||
## Running the Sample | ||
|
||
### Example of Output | ||
|
||
./matrix.dpcpp | ||
Address of buf1 = 0x7f5e687eb010 | ||
Offset of buf1 = 0x7f5e687eb180 | ||
Address of buf2 = 0x7f5e67fea010 | ||
Offset of buf2 = 0x7f5e67fea1c0 | ||
Address of buf3 = 0x7f5e677e9010 | ||
Offset of buf3 = 0x7f5e677e9100 | ||
Address of buf4 = 0x7f5e66fe8010 | ||
Offset of buf4 = 0x7f5e66fe8140 | ||
Using multiply kernel: multiply1 | ||
Running on Intel(R) Gen9 | ||
Elapsed Time: 0.539631s | ||
|
||
## Running an Intel Advisor analysis | ||
------------------------------------------ | ||
|
||
See the Advisor Cookbook here: https://software.intel.com/en-us/advisor-cookbook | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set(CMAKE_CXX_COMPILER dpcpp) | ||
cmake_minimum_required(VERSION 3.0) | ||
project(matrix_multiply) | ||
set(CMAKE_CXX_FLAGS "-g -O3 -fsycl -Wno-write-strings -w -D_Linux") | ||
add_executable(matrix.dpcpp src/matrix.cpp src/multiply.cpp) | ||
add_custom_target(run ./matrix.dpcpp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright Intel Corporation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Matrix Multiply Sample | ||
A sample containing multiple implementations of matrix multiplication. This sample code is implemented using DPC++ language for CPU and GPU. | ||
|
||
| Optimized for | Description | ||
|:--- |:--- | ||
| OS | Linux Ubuntu 18.04; Windows 10 | ||
| Hardware | Kaby Lake with GEN9 or newer | ||
| Software | Intel(R) oneAPI DPC++ Compiler (beta); Intel(R) Advisor | ||
| What you will learn | How to profile an application using Intel(R) Advisor | ||
| Time to complete | 15 minutes | ||
|
||
## Purpose | ||
|
||
The Matrix Multiplication sample performs basic matrix multiplication. Three version are provided that use different features of DPC++. | ||
|
||
## Key Implementation details | ||
|
||
The basic DPC++ implementation explained in the code includes device selector, buffer, accessor, kernel, and command groups. | ||
The include folder is located at %ONEAPI_ROOT%\dev-utilities\latest\include on your development system. | ||
|
||
## License | ||
This code sample is licensed under MIT license | ||
|
||
## How to Build | ||
|
||
This sample contains 3 version of matrix multiplication using DPC++: | ||
|
||
multiply1 – basic implementation of matrix multiply using DPC++ | ||
multiply1_1 – basic implementation that replaces the buffer store with a local accessor “acc” to reduce memory traffic | ||
multiply1_2 – basic implementation plus the local accessor and matrix tiling | ||
|
||
Edit the line in multiply.h to select the version of the multiply function: | ||
#define MULTIPLY multiply1 | ||
|
||
|
||
### On a Linux* System | ||
To build DPC++ version: | ||
cd <sample dir> | ||
cmake . | ||
make | ||
|
||
Clean the program | ||
make clean | ||
|
||
### On a Windows* System Using Visual Studio 2017 or newer | ||
* Open Visual Studio 2017 | ||
* Select Menu "File > Open > Project/Solution", find "matrix_multiply" folder and select "matrix_multiply.sln" | ||
* Select Menu "Project > Build" to build the selected configuration | ||
* Select Menu "Debug > Start Without Debugging" to run the program | ||
|
||
### on Windows - command line - Build the program using MSBuild | ||
DPCPP Configurations: | ||
Release - MSBuild matrix_multiply.sln /t:Rebuild /p:Configuration="Release" | ||
Debug - MSBuild matrix_multiply.sln /t:Rebuild /p:Configuration="Debug" | ||
|
||
|
||
|
||
### Example of Output | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you view this file, the out put for the "example of output" is incorrectly formatted" |
||
|
||
./matrix.dpcpp | ||
|
||
Using multiply kernel: multiply1 | ||
|
||
Running on Intel(R) Gen9 | ||
|
||
Elapsed Time: 0.539631s | ||
|
||
## Running an Intel Advisor analysis | ||
------------------------------------------ | ||
|
||
See the Advisor Cookbook here: https://software.intel.com/en-us/advisor-cookbook | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
| ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29209.62 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "matrix_multiply", "matrix_multiply.vcxproj", "{D209315E-99B1-47B6-9E4B-C922C022BE8C}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{D209315E-99B1-47B6-9E4B-C922C022BE8C}.Debug|x64.ActiveCfg = Debug|x64 | ||
{D209315E-99B1-47B6-9E4B-C922C022BE8C}.Debug|x64.Build.0 = Debug|x64 | ||
{D209315E-99B1-47B6-9E4B-C922C022BE8C}.Release|x64.ActiveCfg = Release|x64 | ||
{D209315E-99B1-47B6-9E4B-C922C022BE8C}.Release|x64.Build.0 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {6553E447-FADC-4836-9E68-26B86B68512B} | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment to Readme in regards to the location of dpc_common.hpp, should look similar to this:
Building the Program for CPU and GPU
Include Files
The include folder is located at %ONEAPI_ROOT%\dev-utilities\latest\include on your development system.
as seen in https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/DPC%2B%2B/CombinationalLogic/sepia-filter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed