PrevUpHomeNext

Home:: tiv.cc   Utxcpp   utx::print   Logs

Intel dpcpp/cpp 2024 published


Intel dpcpp/cpp c++ sycl compiler 2024.0.0 (2024.0.0.20231017) published - Posted on Nov 20, 2023 - See SYCL.tech - - Logs Home - d0002

dpcpp/cpp compiler

dpcpp/cpp compiler is a c++ compiler targeting c++ sycl GPU, FPGA programming by intel.

dpcpp/cpp 2024 Install Guid for Kubuntu Linux

Install c++ sycl dpcpp/cpp compiler for kubuntu linux.

Download dpcpp/cpp

Visit https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html

choose which version you want to use.

For example, I am choosing intel dpc++/c++ for linux 2024.0.0 offline installer, l_dpcpp-cpp-compiler_p_2024.0.0.49524_offline.sh ,

then download it.

Install dpcpp/cpp

Now execute the installer as root user:

$ su
# bash ./l_dpcpp-cpp-compiler_p_2024.0.0.49524_offline.sh

The install prcocess will ask you some questions to continue while installing on terminal, just follow it.

Commonly, the packages will be installed to opt/intel/oneapi

Configure it

Configure it with setvars.sh, that's so easy.

Find where is setvars.sh:

$ cd /opt/intel/oneapi
$ $ find . -name setvars.sh
./setvars.sh

Get the full path of the setvars.sh :

$ realpath ./setvars.sh
/opt/intel/oneapi/setvars.sh

Now source it, to bash, csh or ksh :

$ su -
# echo ". /opt/intel/oneapi/setvars.sh" >> /etc/bash.bashrc
# echo ". /opt/intel/oneapi/setvars.sh" >> ~/.bashrc
$ exit
$ echo ". /opt/intel/oneapi/setvars.sh" >> ~/.bashrc

		# Please logout and login again.

Your dpcpp/cpp compiler for sycl is working :

$ dpcpp
$ dpcpp --version
$ dpcpp --help
$ which dpcpp
/opt/intel/oneapi/compiler/2024.0/bin/dpcpp
$ cd /opt/intel/oneapi/compiler/2024.0/bin/../include
$ ls
std  sycl  xpti
$ ls sycl

c++ sycl example code

the c++ code

#include <sycl/sycl.hpp>
#include <utxcpp/core.hpp>

int main()
try
{
	sycl::queue queue{sycl::gpu_selector_v};
	auto max_cu = queue.get_device().get_info<sycl::info::device::max_compute_units>();
	auto lm_size = queue.get_device().get_info<sycl::info::device::local_mem_size>();
	utx::print("max compute units:", max_cu, "local mem size:", lm_size);
}
catch (const sycl::exception & exc)
{
	utx::printe("--------------------------------------------------------------------------------");
	utx::printe("sycl::exception:", exc.what());
}

Compile it

$ dpcpp prog.cpp -std=c++23 -o prog

See Also

Intel dpcpp/cpp download

Khronos sycl

utx::print

utx::printe

Utxcpp


PrevUpHomeNext