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

SYCL DPC++ auto detect device

aamirkhann
Beginner
1,100 Views

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 Kudos
3 Replies
ManjulaC_Intel
Moderator
1,062 Views

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 Kudos
ManjulaC_Intel
Moderator
1,025 Views

Hi,


A gentle reminder to respond.


Regards,

Manjula


0 Kudos
ManjulaC_Intel
Moderator
1,009 Views

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 Kudos
Reply