Visible to Intel only — GUID: GUID-CC551CB9-8E90-4DC1-8555-0CDEDFF1AF86
Visible to Intel only — GUID: GUID-CC551CB9-8E90-4DC1-8555-0CDEDFF1AF86
Build applications with oneDAL
This section contains instructions for building applications with oneDAL for SYCL*.
Applications on Linux* OS
Install oneDAL.
Set environment variables by calling <install dir>/setvars.sh.
Build the application using icpx (Linux* OS) and icx-cl (Windows* OS) commands:
Add oneDAL includes folder:
-I<install dir>/dal/latest/include
Add oneDAL libraries. Choose the appropriate oneDAL libraries based on oneDAL linking method:
oneDAL libraries for Linux Static linking
libonedal_core.a,
libonedal_dpc.a,
libonedal_parameters.a,
libonedal_parameters_dpc.a,
libonedal_thread.a
Dynamic linking
libonedal_core.so,
libonedal_dpc.so,
libonedal_parameters.so,
libonedal_parameters_dpc.so,
libonedal_thread.so
Add an additional oneDAL library:
<install dir>/dal/latest/lib/libonedal_sycl.a
Applications on Windows* OS
Install oneDAL.
In Microsoft Visual Studio* Integrated Development Environment (IDE), open or create a C++ project for your oneDAL application to build.
In project properties:
Set Intel® oneAPI DPC++/C++ Compiler platform toolset:
Add oneDAL includes folder to Additional Include Directories.
Add folders with oneDAL and oneTBB libraries to Library Directories:
Add oneDAL and OpenCL libraries to Additional Dependencies:
Add the appropriate libraries to your project based on oneDAL linking method:
oneDAL libraries for Windows Static linking
onedal_core.lib,
onedal_core.lib,
onedal_thread.lib
Dynamic linking
onedal_core_dll.lib
onedal_core_dll.lib
You may also add debug versions of the libraries based on the threading mode and linking method:
oneDAL debug libraries for Windows Static linking
onedal_cored.lib,
onedald.lib,
onedal_dpcd.lib,
onedal_sycld.lib,
onedal_cored.lib,
onedald.lib,
onedal_dpcd.lib,
onedal_sycld.lib,
onedal_threadd.lib
Dynamic linking
onedal_cored_dll.lib (onedal_cored_dll.2.lib),
onedald_dll.lib (onedald_dll.2.lib),
onedal_dpcd_dll.lib (onedal_dpcd_dll.2.lib),
onedald.2.dll,
onedal_cored.2.dll,
onedal_dpcd.2.dll,
onedal_cored_dll.lib (onedal_cored_dll.2.lib),
onedald_dll.lib (onedald_dll.2.lib),
onedal_dpcd_dll.lib (onedal_dpcd_dll.2.lib),
onedald.2.dll,
onedal_cored.2.dll,
onedal_dpcd.2.dll,
onedal_threadd.2.dll
Examples
Dynamic linking oneDAL with the GPU target:
Linux* OS:
icpx -fsycl my_first_dal_program.cpp -Wl, --start-group -L<install dir>/dal/latest/lib -lonedal_core -lonedal_dpc -lonedal_parameters_dpc -lonedal_thread -lpthread -ldl -lOpenCL -L<install dir>/tbb/latest/lib/ -ltbb -ltbbmalloc <install dir>/dal/latest/lib/libonedal_sycl.a -Wl,--end-group
Windows* OS:
icx-cl -fsycl my_first_dal_program.cpp -Wl, --start-group -L<install dir>/dal/latest/lib/ -lonedal_core -lonedal_dpc -lonedal_thread -lpthread -ldl -lOpenCL -L<install dir>/tbb/latest/lib/ -ltbb -ltbbmalloc <install dir>/dal/latest/lib/libonedal_sycl.a -Wl,--end-group