<jupyter_start><jupyter_text>Introduction to oneAPI and SYCL  Sections- [oneAPI Programming Model Overview](oneAPI-Software-Model-Overview)- [Programming Challenges for Multiple architectures](Programming-Challenges-for-Multiple-architectures)- [Introducing oneAPI](Introducing-oneAPI)- _Code:_ [SYCL Hello World](Simple-Exercise)- [What is SYCL](SYCL)- [How to Compile & Run a SYCL program](How-to-Compile-&-Run-SYCL-program)  Learning Objectives* Explain how the __oneAPI__ programming model can solve the challenges of programming in a heterogeneous world * Use oneAPI projects to enable your workflows* Understand the __SYCL__ language and programming model* Familiarization on the use Jupyter notebooks for training throughout the course  oneAPI Programming Model OverviewThe __oneAPI__ programming model provides a comprehensive and unified portfolio of developer tools that canbe used across hardware targets, including a range of performance libraries spanning several workloaddomains. The libraries include functions custom-coded for each target architecture so the samefunction call delivers optimized performance across supported architectures. __DPC++__ is based onindustry standards and open specifications to encourage ecosystem collaboration and innovation. oneAPI DistributionIntel&reg; oneAPI toolkits are available via multiple distribution channels:* Local product installation: install the oneAPI toolkits from the __Intel® Developer Zone__.* Install from containers or repositories: install the oneAPI toolkits from one of several supportedcontainers or repositories.* Pre-installed in the __Intel® DevCloud__: a free development sandbox for access to the latest Intel® SVMS hardware and select oneAPI toolkits.   Programming Challenges for Multiple architecturesCurrently in the data centric space there is growth in specialized workloads. Each kind of data centric hardware typically needs to be programmed using different languages and libraries as there is no common programming language or APIs, this requires maintaining separate code bases. Developers have to learn a whole set of different tools as there is inconsistent tool support across platforms. Developing software for each hardware platform requires a separate investment, with little ability to reuse that work to target a different architecture. You will also have to consider the requirement of the diverse set of data-centric hardware.  Introducing oneAPI__oneAPI__ is a solution to deliver unified programming model to __simplify development__ across diverse architectures. It includes a unified and simplified language and libraries for expressing __parallelism__ and delivers uncompromised native high-level language performance across a range of hardware including __CPUs, GPUs, FPGAs__. oneAPI initiative is based on __industry standards and open specifications__ and is interoperable with existing HPC programming models. *** Simple ExerciseThis exercise introduces SYCL to the developer by way of a small simple code. In addition, it introduces the developer to the Jupyter notebook environment for editing and saving code; and for running and submitting programs to the Intel® DevCloud.  Editing the simple.cpp codeThe Jupyter cell below with the gray background can be edited in-place and saved.The first line of the cell contains the command **%%writefile 'simple.cpp'** This tells the input cell to save the contents of the cell into a file named 'simple.cpp' in your current directory (usually your home directory). As you edit the cell and run it in the Jupyter notebook, it will save your changes into that file.The code below is some simple SYCL code to get you started in the DevCloud environment. Simply inspect the code - there are no modifications necessary. Run the first cell to create the file, then run the cell below it to compile and execute the code.1. Inspect the code cell below, then click run ▶ to save the code to a file2. Run ▶ the cell in the __Build and Run__ section below the code snippet to compile and execute the code in the saved file<jupyter_code>%%writefile lab/simple.cpp
//==============================================================
// Copyright © Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
#include <CL/sycl.hpp>
using namespace sycl;
static const int N = 16;
int main(){
  //# define queue which has default device associated for offload
  queue q;
  std::cout << "Device: " << q.get_device().get_info<info::device::name>() << "\n";

  //# Unified Shared Memory Allocation enables data access on host and device
  int *data = malloc_shared<int>(N, q);

  //# Initialization
  for(int i=0; i<N; i++) data[i] = i;

  //# Offload parallel computation to device
  q.parallel_for(range<1>(N), [=] (id<1> i){
    data[i] *= 2;
  }).wait();

  //# Print Output
  for(int i=0; i<N; i++) std::cout << data[i] << "\n";

  free(data, q);
  return 0;
}<jupyter_output><empty_output><jupyter_text>Build and RunSelect the cell below and click Run ▶ to compile and execute the code above:<jupyter_code>! chmod 755 q; chmod 755 run_simple.sh;if [ -x "$(command -v qsub)" ]; then ./q run_simple.sh; else ./run_simple.sh; fi<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08303180346600647, 'fraction_numerical': 0.00304703865930299, 'mean_word_length': 5.2673031026252985, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '571745', 'license': 'MIT', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1240, 'n_words': 671, 'path': 'DirectProgramming/DPC++/Jupyter/oneapi-essentials-training/01_oneAPI_Intro/oneAPI_Intro.ipynb', 'repo_name': 'krisrak/oneAPI-samples', 'size': '5251'}