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

Convert cuFFT using Compatibility Tool

AE6
Novice
3,023 Views

Hello,

 

I'm trying to convert cuFFT code using the cuda conversion tool. 

It generates dpcpp code with the function dpct::fft::fft, when I compile that code using the following command:

icpx -fsycl 1d_c2c_example.cpp.dp.cpp

it generates the following error:

1d_c2c_example.cpp.dp.cpp:62:11: error: no member named 'fft' in namespace 'dpct'

    dpct::fft::fft_engine_ptr plan;

    ~~~~~~^

 

And the same error is generated when I compile for GPU using the flag: 

-fsycl-targets=nvptx64-nvidia-cuda

 

I can't find any documentation for dpct::fft::fft, and I am using the latest release for the Intel oneAPI base toolkit.

 

Thanks.

0 Kudos
11 Replies
VarshaS_Intel
Moderator
2,978 Views

Hi,


Thanks for posting in Intel Communities.


Could you please let us know the OS details and Hardware details?


In case, if you are using Nvidia hardware then you need to use the Open Source MKL as Intel oneMKL is not supported.


Could you please let us know the complete steps/procedure you followed to migrate the cuda code to dpc++? And also, could you please confirm if you had migrated all the headers properly or not?


If possible, could you please provide us with the complete project file you are using?


Thanks & Regards,

Varsha


0 Kudos
AE6
Novice
2,958 Views

Hello,

 Thanks for your response.

 

OS: Ubuntu 20.04.5

HW:  Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GH + Tesla V100

oneAPI version: Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230622)

CUDA: release 12.0, V12.0.76

cuFFT Code to convert: https://github.com/NVIDIA/CUDALibrarySamples/tree/master/cuFFT/1d_c2c

Command used to convert: 

c2s -in-root=. --extra-arg=-xc++ 1d_c2c_example.cpp --cuda-include-path=/usr/local/cuda/include

 

Compile generated files:

icpx  -fsycl -fsycl-targets=nvptx64-nvidia-cuda   -c 1d_c2c_example.cpp.dp.cpp -o a.o

 

Listed above all details about the project, the generated code is not fully migrated, but the error mentioned above is related to dpct::fft which is not mentioned in any DPC++ documentation, Isn't oneMKL an open source MKL?

 

0 Kudos
VarshaS_Intel
Moderator
2,881 Views

Hi,


Thanks for the details.


Intel oneAPI DPC++ can be used only with Intel GEN9 and higher GPUs.


Here is the link for Intel® oneAPI DPC++/C++ Compiler System Requirements:

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html


If you want to use the DPC++ compiler with NVIDIA GPU you can use the opensource DPC++ compiler.


Please refer to the below link regarding the opensource oneAPI DPC++ compiler:

https://intel.github.io/llvm-docs/GetStartedGuide.html


These forums are intended to support queries related to Intel Products. Here, we do not provide support to the NVidia GPU and c2s. You can also get support for non-Intel GPUs. Please find the link for raising the queries: https://github.com/intel/llvm/issues

https://github.com/oneapi-src/SYCLomatic/issues


>> Isn't oneMKL an open source MKL?

Intel oneMKL is not entirely open source but is free to download and use the latest version. If you want to use the open-source MKL, please find the below link:

https://github.com/oneapi-src/oneMKL


Thanks & Regards,

Varsha


0 Kudos
AE6
Novice
2,860 Views

Intel oneAPI DPC++ can be used only with Intel GEN9 and higher GPUs.

The statement above is not correct, on the first link you provided, I can see that there is a Codeplay plugins to run Intel oneAPI DPC++ on Nvidia GPU. Can you please verify?

 

 

 

Thanks.

0 Kudos
VarshaS_Intel
Moderator
2,814 Views

Hi,

 

Apologies for the inconvenience caused to you. Yes, it will work only if there are plugins. When we tried the code using c2s along with the command add "--gen-helper-function" which will generate helper function files in the --out-root directory. It will create an include directory in the out-root directory.

 

Also, you can add the header #include <dpct/fft_utils.hpp> to the migrated code and compile with the below command:

icpx -fsycl 1d_c2c_example.cpp.dp.cpp -I include/ -I ../../utils/ -qmkl

Could you please try and let us know if you are able to compile without any errors?

 

Thanks & Regards,

Varsha

 

 

0 Kudos
VarshaS_Intel
Moderator
2,757 Views

Hi,


We have not heard back from you. Could you please provide us with an update on your issue?


Thanks & Regards,

Varsha


0 Kudos
AE6
Novice
2,733 Views

Hello!

 

Thanks for your reply!

 

I've tried the steps provided and it fixed the error regarding the fft function!

My concern is that the generated code is compiled only for CPU, and when I try to compile it for GPU using the command line flag "-fsycl-targets=<>" it generates GPU code, but when executed the output result for the FFT operation is the same exact as the input array, which means the most probably the oneMKL FFT operation is not supported on GPU, can you please verify this assumption?

 

Thanks,

Alaa

0 Kudos
VarshaS_Intel
Moderator
2,613 Views

Hi,


Thanks for your reply.


Could you please provide us with the migrated code that you are able to run the code successfully on the CPU?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
2,440 Views

Hi,

 

Apologies for the delay.

 

We tried executing the migrated code and here are our observations

Compilation command on CPU/GPU): icpx -fsycl 1d_c2c_example.cpp.dp.cpp -I include/ -I ../../utils/ -qmkl
Execution command: SYCL_PI_TRACE=1 ./a.out

The migrated code gives the expected results when running on both Intel CPU & GPU. Please find the below attached screenshot for more details.

>>when executed the output result for the FFT operation is the same exact as the input array, which means the most probably the oneMKL FFT operation is not supported on GPU

 As you are trying to run the migrated code on NVIDIA GPU you need to link it against open-source oneMKL https://github.com/oneapi-src/oneMKL and not Intel oneMKL. If you still get incorrect results please raise an issue here (https://github.com/oneapi-src/oneMKL/issues) to get better assistance as here we only provide support to the queries related to Intel products.

 

You can get back to us if you face any issues with the results on Intel CPU/GPU.

 

Thanks & Regards,

Varsha

 

0 Kudos
VarshaS_Intel
Moderator
2,341 Views

Hi,


We have not heard back from you. Could you please let us know if you need any other details? If not, can we go ahead and close this thread?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
2,200 Views

Hi,


We have not heard back from you. We assume that your issue is resolved. This thread will no longer be monitored by Intel. If you have any other queries, please start a new thread.


Thanks & Regards,

Varsha


0 Kudos
Reply