Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL

SYCL DPC++ auto detect device

aamirkhann
初学者
1,546 次查看

This question might be trival, unfortunately I haven't found the answer I was looking for. I used DPCT migration tool to port some cuda code to intel DPC++ and then I further optimized everything I needed and eventually got rid of everything related to DPCT expect the super handy

dpct::get_current_device();

which basically solves all the previous pain I had to put compile options to select the appropriate device and control them with Makefiles and so on.

Is there any way to do this without using dpct ? I had a look at how dpct does this (here) but it looks pretty non_straightforward and it relies on other internal functions.

Is there any way to avoid this ?

0 项奖励
3 回复数
ManjulaC_Intel
主持人
1,508 次查看

Hi,

 

Thanks for reaching out to us.

 

>>Is there any way to do this without using dpct ? I had a look at how dpct does this (here) but it looks pretty non_straightforward and it relies on other internal functions.

 

You can try replacing  dpct::get_current_device() with 

 q_ct1.get_device().get_info<sycl::info::device::name>()

 

For more information refer the below link:

https://intel.github.io/llvm-docs/doxygen/classcl_1_1sycl_1_1queue.html#a2f991915c57bfb1d73992fde421d56c8

 

Regards,

Manjula

 

0 项奖励
ManjulaC_Intel
主持人
1,471 次查看

Hi,


A gentle reminder to respond.


Regards,

Manjula


0 项奖励
ManjulaC_Intel
主持人
1,455 次查看

Hi,


I have not heard back from you. I assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Regards,

Manjula




0 项奖励
回复