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 your application with dpcpp:
Add oneDAL
includes
folder:-I<install dir>/dal/latest/include
Add oneDAL libraries. Choose the appropriate oneDAL libraries based on oneDAL threading mode and linking method:
oneDAL libraries for Linux¶ Single-threaded (non-threaded)
Multi-threaded (internally threaded)
Static linking
libonedal_core.a,libonedal_dpc.a,libonedal_sequential.alibonedal_core.a,libonedal_dpc.a,libonedal_thread.aDynamic linking
libonedal_core.so,libonedal_dpc.so,libonedal_sequential.solibonedal_core.so,libonedal_dpc.so,libonedal_thread.soAdd an additional oneDAL library:
<install dir>/dal/latest/libintel64/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:
Add the appropriate libraries to your project based on oneDAL threading mode and linking method:
oneDAL libraries for Windows¶ Single-threaded (non-threaded)
Multi-threaded (internally threaded)
Static linking
onedal_core.lib,onedal_sequential.libonedal_core.lib,onedal_thread.libDynamic 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¶ Single-threaded (non-threaded)
Multi-threaded (internally threaded)
Static linking
onedal_cored.lib,onedald.lib,onedal_dpcd.lib,onedal_sycld.lib,onedal_sequentiald.libonedal_cored.lib,onedald.lib,onedal_dpcd.lib,onedal_sycld.lib,onedal_threadd.libDynamic linking
onedal_cored_dll.lib (onedal_cored_dll.1.lib),onedald_dll.lib (onedald_dll.1.lib),onedal_dpcd_dll.lib (onedal_dpcd_dll.1.lib),onedald.1.dll,onedal_cored.1.dll,onedal_dpcd.1.dll,onedal_sequentiald.1.dllonedal_cored_dll.lib (onedal_cored_dll.1.lib),onedald_dll.lib (onedald_dll.1.lib),onedal_dpcd_dll.lib (onedal_dpcd_dll.1.lib),onedald.1.dll,onedal_cored.1.dll,onedal_dpcd.1.dll,onedal_threadd.1.dll
Examples¶
Dynamic linking, Multi-threaded oneDAL:
dpcpp my_first_dal_program.cpp -Wl,
--start-group -L<install dir>/dal/latest/lib/intel64 -lonedal_core -lonedal_dpc -lonedal_thread -lpthread -ldl -lOpenCL -L<install dir>/tbb/latest/lib/intel64/gcc4.8 -ltbb -ltbbmalloc <install dir>/dal/latest/lib/intel64/libonedal_sycl.a -Wl,--end-group
Static linking, Single-threaded oneDAL:
dpcpp my_first_dal_program.cpp -Wl,
--start-group <install dir>/dal/latest/lib/intel64/libonedal_core.a <install dir>/dal/latest/lib/intel64/libonedal_dpc.a <install dir>/dal/latest/lib/intel64/libonedal_sequential.a -lpthread -ldl -lOpenCL <install dir>/dal/latest/lib/intel64/libonedal_sycl.a -Wl,--end-group