Get Started with the Intel®
oneAPI Data Analytics Library 1
Intel® oneAPI Data Analytics Library (oneDAL) is a library that helps speed up big data analysis by providing
highly optimized algorithmic building blocks for all stages of data analytics (preprocessing, transformation,
analysis, modeling, validation, and decision making) in batch, online, and distributed processing modes of
computation.
For general information about oneDAL, visit oneDAL official page.
Before You Begin
oneDAL is located in <install_dir>/dal directory where <install_dir> is the directory in which Intel®
oneAPI Base Toolkit was installed.
The current version of oneDAL with SYCL support is available for Linux* and Windows* 64-bit operating
systems. The prebuilt oneDAL libraries can be found in the <install_dir>/dal/<version>/redist
directory.
To learn about the system requirements and the dependencies needed to build examples, refer to the System
Requirements page.
End-to-end Example
Below you can find a typical usage workflow for a oneDAL algorithm on GPU. The example is provided for
Principal Component Analysis algorithm (PCA).
The following steps depict how to:
• Read the data from CSV file
• Run the training and inference operations for PCA
• Access intermediate results obtained at the training stage
1. Include the following header that makes all oneDAL declarations available.
#include "oneapi/dal.hpp"
/* Standard library headers required by this example */
#include <cassert>
#include <iostream>
2. Create a SYCL* queue with the desired device selector. In this case, GPU selector is used:
const auto queue = sycl::queue{ sycl::gpu_selector{} };
3. Since all oneDAL declarations are in the oneapi::dal namespace, import all declarations from the
oneapi namespace to use dal instead of oneapi::dal for brevity:
using namespace oneapi;
4. Use CSV data source to read the data from the CSV file into a table:
const auto data = dal::read<dal::table>(queue, dal::csv::data_source{"data.csv"});
5. Create a PCA descriptor, configure its parameters, and run the training algorithm on the data loaded
from CSV.
const auto pca_desc = dal::pca::descriptor<float>
.set_component_count(3)
.set_deterministic(true);
const dal::pca::train_result train_res = dal::train(queue, pca_desc, data);
Get Started with the Intel® oneAPI Data Analytics Library 1
3