DPCT1100#
Message#
Currently the DFT external workspace feature in the IntelĀ® oneAPI Math Kernel Library (oneMKL) is only supported on GPU devices. Use the internal workspace if your code should run on non-GPU devices.
Detailed Help#
The FFT of IntelĀ® oneAPI Math Kernel Library can use either an internal workspace or external workspace during computation. The internal workspace mode is supported on all devices, while the external workspace mode is currently only supported on GPU devices.
Suggestions to Fix#
If you are running code on a non-GPU device, you can:
Use
dpct::select_device(<device_id>)
to choose a GPU device.Call
dpct::fft::fft_engine::use_internal_workspace(true)
before invokingdpct::fft::fft_engine::commit()
.
For example, this original CUDA* code:
1void foo(cufftHandle plan, float2 *idata, float2 *odata) {
2 size_t worksize;
3 void *workspace;
4 cufftSetAutoAllocation(plan, 0);
5 cufftMakePlan1d(plan, 7, CUFFT_C2C, 2, &worksize);
6 cudaMalloc(&workspace, worksize);
7 cufftSetWorkArea(plan, workspace);
8 cufftExecC2C(plan, idata, odata, CUFFT_FORWARD);
9 ...
10}
results in the following migrated SYCL code:
1void foo(dpct::fft::fft_engine_ptr plan, sycl::float2 *idata,
2 sycl::float2 *odata) {
3 dpct::device_ext &dev_ct1 = dpct::get_current_device();
4 sycl::queue &q_ct1 = dev_ct1.in_order_queue();
5 size_t worksize;
6 void *workspace;
7 /*
8 DPCT1100:0: Currently the DFT external workspace feature in the Intel(R)
9 oneAPI Math Kernel Library (oneMKL) is only supported on GPU devices. Use the
10 internal workspace if your code should run on non-GPU devices.
11 */
12 plan->use_internal_workspace(0);
13 /*
14 DPCT1100:1: Currently the DFT external workspace feature in the Intel(R)
15 oneAPI Math Kernel Library (oneMKL) is only supported on GPU devices. Use the
16 internal workspace if your code should run on non-GPU devices.
17 */
18 /*
19 DPCT1099:2: Verify if the default value of the direction and placement used in
20 the function "commit" is correct.
21 */
22 plan->commit(&q_ct1, 7, dpct::fft::fft_type::complex_float_to_complex_float,
23 2, &worksize);
24 workspace = (void *)sycl::malloc_device(worksize, q_ct1);
25 /*
26 DPCT1100:3: Currently the DFT external workspace feature in the Intel(R)
27 oneAPI Math Kernel Library (oneMKL) is only supported on GPU devices. Use the
28 internal workspace if your code should run on non-GPU devices.
29 */
30 plan->set_workspace(workspace);
31 plan->compute<sycl::float2, sycl::float2>(idata, odata,
32 dpct::fft::fft_direction::forward);
33 ...
34}
which is rewritten to:
1void foo(dpct::fft::fft_engine_ptr plan, sycl::float2 *idata,
2 sycl::float2 *odata) {
3 dpct::device_ext &dev_ct1 = dpct::get_current_device();
4 sycl::queue &q_ct1 = dev_ct1.in_order_queue();
5 size_t worksize;
6 void *workspace;
7 if (dev_ct1.is_gpu())
8 plan->use_internal_workspace(0);
9 plan->commit(&q_ct1, 7, dpct::fft::fft_type::complex_float_to_complex_float,
10 2, &worksize);
11 if (dev_ct1.is_gpu()) {
12 workspace = (void *)sycl::malloc_device(worksize, q_ct1);
13 plan->set_workspace(workspace);
14 }
15 plan->compute<sycl::float2, sycl::float2>(idata, odata,
16 dpct::fft::fft_direction::forward);
17 ...
18}