Visible to Intel only — GUID: GUID-86BB4E7E-A972-4D12-A283-787533EB745F
Visible to Intel only — GUID: GUID-86BB4E7E-A972-4D12-A283-787533EB745F
DPCT1099
Message
Verify if the default value of the direction and placement used in the function <function name> aligns with the related compute function call.
Detailed Help
By default, the parameter direction_and_placement is not passed for dpct::fft::fft_engine::create(), dpct::fft::fft_engine::commit(), or dpct::fft::fft_engine::estimate_size(). In this case, a forward direction (if the current FFT is complex-to-complex) and out-of-place (false) are used as the default values in this API. The configuration of the direction and placement is reset when executing dpct::fft::fft_engine::compute() according to the argument passed with the compute() API. There might be performance issues caused by the reconfiguration.
To avoid the potential performance issues, specify the parameter direction_and_placement explicitly when calling dpct::fft::fft_engine::create() or dpct::fft::fft_engine::commit(), then the direction and placement information passed by the compute() API is ignored and no reconfiguration happens.
Suggestions to Fix
If you received a warning for dpct::fft::fft_engine::create() or dpct::fft::fft_engine::commit():
If you are using an internal workspace and do not care about performance, you can ignore this warning.
If you do care about performance, or if you are using an external workspace, specify the direction_and_placement parameter correctly.
If you received this warning for dpct::fft::fft_engine::estimate_size(), you need to specify the direction_and_placement parameter correctly.
For example, this original CUDA* code:
void foo(cufftHandle plan, float2 *idata, float2 *odata) {
size_t worksize;
cufftMakePlan1d(plan, 7, CUFFT_C2C, 2, &worksize);
cufftExecC2C(plan, idata, odata, CUFFT_INVERSE);
}
results in the following migrated SYCL code:
void foo(dpct::fft::fft_engine_ptr plan, sycl::float2 *idata,
sycl::float2 *odata) {
size_t worksize;
/*
DPCT1100:0: Currently the DFT external workspace feature in the Intel(R)
oneAPI Math Kernel Library (oneMKL) is only supported on GPU devices. Use the
internal workspace if your code should run on non-GPU devices.
*/
/*
DPCT1099:1: Verify if the default value of the direction and placement used in
the function "commit" aligns with the related "compute" function call.
*/
plan->commit(&dpct::get_in_order_queue(), 7,
dpct::fft::fft_type::complex_float_to_complex_float, 2,
&worksize);
plan->compute<sycl::float2, sycl::float2>(idata, odata,
dpct::fft::fft_direction::backward);
}
which is rewritten to:
void foo(dpct::fft::fft_engine_ptr plan, sycl::float2 *idata,
sycl::float2 *odata) {
// idata and odata are different memory
size_t worksize;
plan->commit(
&dpct::get_in_order_queue(), 7,
dpct::fft::fft_type::complex_float_to_complex_float, 2, &worksize,
std::make_pair(
dpct::fft::fft_direction::backward /*In the next compute() function,
the direction is backward. So no need to change here.*/
,
false /*is_inplace. In the next compute() function, idata and
odata are different memory, so set false here*/
));
plan->compute<sycl::float2, sycl::float2>(idata, odata,
dpct::fft::fft_direction::backward);
}