From a922c6061da7510cb71580d9057f969eb75f211f Mon Sep 17 00:00:00 2001 From: Michael Kinsner Date: Wed, 7 Oct 2020 09:01:15 -0300 Subject: [PATCH] Update license and readme --- LICENSE.txt | 51 +++++++++++++++++++++++--------------------------- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 72 insertions(+), 33 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 710f721..90ec8e7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,28 +1,23 @@ -Freeware License, some rights reserved - -Copyright (c) 2020 James Reinders, Ben Ashbaugh, James Brodman, Michael Kinsner, John Pennycook, Xinmin Tian - - -Permission is hereby granted, free of charge, to anyone obtaining a copy -of this software and associated documentation files (the "Software"), -to work with the Software within the limits of freeware distribution and fair use. -This includes the rights to use, copy, and modify the Software for personal use. -Users are also allowed and encouraged to submit corrections and modifications -to the Software for the benefit of other users. - -It is not allowed to reuse, modify, or redistribute the Software for -commercial use in any way, or for a user’s educational materials such as books -or blog articles without prior permission from the copyright holder. - -The above copyright notice and this permission notice need to 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 OR APRESS 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. - - +MIT License + +Copyright (C) 2020 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. + +SPDX-License-Identifier: MIT diff --git a/README.md b/README.md index a5592cf..4c8a6c8 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,60 @@ -# Apress Source Code +# Data Parallel C++ Book Source Samples This repository accompanies [*Data Parallel C++: Mastering DPC++ for Programming of Heterogeneous Systems using C++ and SYCL*](https://www.apress.com/9781484255735) by James Reinders, Ben Ashbaugh, James Brodman, Michael Kinsner, John Pennycook, Xinmin Tian (Apress, 2020). [comment]: #cover ![Cover image](9781484255735.jpg) +Many of the samples in the book are snips from the more complete files in this repository. The full files contain supporting code, such as header inclusions, which are not shown in every listing within the book. The complete listings are intended to compile and be modifiable for experimentation. + Download the files as a zip using the green button, or clone the repository to your machine using Git. -## Releases +## How to Build the Samples + +To build and use these examples, you will need an installed DPC++ toolchain. For one such toolchain, please visit: + +https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-compiler.html + +Alternatively, much of the toolchain can be built directly from: + +https://github.com/intel/llvm + +Some of the Chapter 18 examples require an installation of oneDPL, which is available from: + +https://github.com/oneapi-src/oneDPL + + +To build the samples: + +1. Setup oneAPI environment variables: + + On Windows: + + ```sh + \path\to\inteloneapi\setvars.bat + ``` + + On Linux: + + ```sh + source /path/to/inteloneapi/setvars.sh + ``` + +2. Create build files using CMake, specifying the DPC++ toolchain. For example: + + ```sh + mkdir build && cd build + cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=../dpcpp_toolchain.cmake .. + ``` + + NOTE: If you do not have oneDPL installed, you can disable compilation of those tests with the option `NODPL` -Release v1.0 corresponds to the code in the published book, without corrections or updates. + ```sh + cmake -G Ninja -DNODPL=1 -DCMAKE_TOOLCHAIN_FILE=../dpcpp_toolchain.cmake .. + ``` -## Contributions +3. Build with the generated build files: -See the file Contributing.md for more information on how you can contribute to this repository. \ No newline at end of file + ```sh + ninja install + ```