-
Notifications
You must be signed in to change notification settings - Fork 708
Readme template
This is a template for creating the readme.md file for oneAPI Code samples. All sections are required, but modify as needed for your code sample
---Delete this line and everything above---
# Mandelbrot
Sample
Optimized for | Description |
---|---|
OS | Linux* Ubuntu* 18.04; Windows 10 |
Hardware | Skylake with GEN9 or newer |
Software | Intel® oneAPI DPC++/C++ Compiler |
What you will learn | |
Time to complete | xx minutes |
Example: The code will attempt to execute on an available GPU and fall back to the system's CPU if a compatible GPU is not detected. The compilation device is displayed in the output along with elapsed time to render the Mandelbrot image. This helps compare different offload implementations based on the complexity of the computation.
Example: The basic DPC++ implementation explained in the code includes device selector, buffer, accessor, kernel, and command groups.
Code samples are licensed under the MIT license. See License.txt for details.
Third-party program Licenses can be found here: third-party-programs.txt
Note: if you have not already done so, set up your CLI environment by sourcing the setvars script located in the root of your oneAPI installation.
Linux Sudo: . /opt/intel/oneapi/setvars.sh
Linux User: . ~/intel/oneapi/setvars.sh
Windows: C:\Program Files(x86)\Intel\oneAPI\setvars.bat
The include folder is located at %ONEAPI_ROOT%\dev-utilities\latest\include on your development system.
Example: If running a sample in the Intel DevCloud, remember that you must specify the compute node (CPU, GPU, FPGA) and whether to run in batch or interactive mode. For more information, see the Intel® oneAPI Base Toolkit Get Started Guide (https://devcloud.intel.com/oneapi/get-started/base-toolkit/)Perform the following steps:
- Build the program using the following
cmake
commands.
$ mkdir build
$ cd build
$ cmake ..
$ make
- Run the program (default uses buffers):
make run
Note: for USM use
make run_usm
- Clean the program using:
make clean
-
Build the program using VS2017 or VS2019
- Right-click on the solution file and open using either VS2017 or VS2019 IDE.
- Right-click on the project in Solution Explorer and select Rebuild.
- From the top menu, select Debug -> Start without Debugging.
-
Build the program using MSBuild
- Open "x64 Native Tools Command Prompt for VS2017" or "x64 Native Tools Command Prompt for VS2019"
- Run the following command:
MSBuild mandelbrot.sln /t:Rebuild /p:Configuration="Release"
You can modify the Mandelbrot parameters from within mandel.hpp. The configurable parameters include: row_size = col_size = max_iterations = repetitions = The default row and column size are 512. Max interatins and repetitions are both 100. By adjusting the parameters, you can observe how the performance varies using the different offload techniques.
Note: If the values drop below 128 for row and column, the output is limited to just text in the output window.
Platform Name: Intel(R) OpenCL HD Graphics
Platform Version: OpenCL 2.1
Device Name: Intel(R) Gen9 HD Graphics NEO
Max Work Group: 256
Max Compute Units: 24
Parallel Mandelbrot set using buffers.
Rendered image output to file: mandelbrot.png (output too large to display in text)
Serial time: 0.0430331s
Parallel time: 0.00224131s
Successfully computed Mandelbrot set.
- Home
- DPC++ what is it?
- Administration
- sample.json
- Sample Browser
- GitHub Steps for Contribution
- New Sample Submission
- Guidelines