Build applications with oneDAL
Applications on Windows* OS
- Download and install Intel® oneAPI Base Toolkit.
- 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 oneDALincludesfolder 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 threading mode and linking method:Single-threaded (non-threaded) oneDALMulti-threaded (internally threaded) oneDALStatic linkingonedal_core.lib, onedal_sequential.libonedal_core.lib, onedal_thread.libDynamic linkingonedal_core_dll.libonedal_core_dll.lib
Applications on Linux* OS
- Download and install Intel® oneAPI Base Toolkit.
- Set environment variables by calling<install dir>/setvars.sh.
- Build your application with clang++:
- Addfsycloption to the command:-fsycl
- AddONEAPI_DAAL_USE_MKL_GPU_GEMMdefinition:-DONEAPI_DAAL_USE_MKL_GPU_GEMM
- Add oneDALincludesfolder:-I<install dir>/daal/latest/include
- Add oneDAL libraries. Choose the appropriate oneDAL libraries based on oneDAL threading mode and linking method:Single-threaded (non-threaded) oneDALMulti-threaded (internally threaded) oneDALStatic linkinglibonedal_core.a, libonedal_sequential.alibonedal_core.a, libonedal_thread.aDynamic linkinglibonedal_core.so, libonedal_sequential.solibonedal_core.so, libonedal_thread.so
Add an additional oneDAL library:
-foffload-static-lib=<install dir>/daal/latest/libintel64/libonedal_sycl.a
Examples
Dynamic linking, Multi-threaded oneDAL:
clang++ -fsycl -DONEAPI_DAAL_USE_MKL_GPU_GEMM my_first_daal_program.cpp -Wl,
--start-group -L<install dir>/daal/latest/lib/intel64 -lonedal_core -lonedal_thread.so -lpthread -ldl -lOpenCL -L<install dir>/tbb/latest/lib/intel64/gcc4.8 -ltbb -ltbbmalloc -foffload-static-lib=<install dir>/daal/latest/lib/intel64/libonedal_sycl.a -Wl,--end-group
Static linking, Single-threaded oneDAL:
clang++ -fsycl -DONEAPI_DAAL_USE_MKL_GPU_GEMM my_first_daal_program.cpp -Wl,
--start-group <install dir>/daal/latest/lib/intel64/libonedal_core.a <install dir>/daal/latest/lib/intel64/libonedal_sequential.a -lpthread -ldl -lOpenCL -foffload-static-lib=<install dir>/daal/latest/lib/intel64/libonedal_sycl.a -Wl,--end-group