Developer Guide and Reference

  • 2021.4
  • 09/27/2021
  • Public Content

DPCT1084

Message

The function call has multiple migration results in different template instantiations that could not be unified. You may need to adjust the code.

Detailed Help

The Intel® DPC++ Compatibility Tool was unable to migrate the code correctly. Modify the code manually.
The following example shows original code, migrated code, and the manual changes made to correct the migrated code.
For example, this original code:
// original code: __constant__ int4 example_i[32]; __constant__ float4 example_f[32]; struct example_int { __device__ int4 foo(int idx) const { return example_i[idx]; } }; struct example_float { __device__ float4 foo(int idx) const { return example_f[idx]; } }; template <typename T> _global_ void example_kernel() { ... T example_v; float j = example_v.foo(idx).x; }
results in the following migrated DPC++ code:
// migrated DPC++ code: dpct::constant_memory<sycl::int4, 1> example_i(32); dpct::constant_memory<sycl::float4, 1> example_f(32); struct example_int { sycl::int4 foo()(int idx, sycl::int4 *example_i) const { return example_i[idx]; } }; struct example_float { sycl::float4 foo()(int idx, sycl::float4 *example_i) const { return example_i[idx]; } }; template <typename T> void example_kernel(sycl::nd_item<3> item_ct1, sycl::float4 *example_f) { ... T example_v; /* DPCT1083 */ float j = example_v.foo(idx, example_f).x(); }
which is manually adjusted to:
// adjusted DPC++ code: dpct::constant_memory<sycl::int4, 1> example_i(32); dpct::constant_memory<sycl::float4, 1> example_f(32); struct example_int { typedef sycl::int4 data_type; sycl::int4 foo()(int idx, sycl::int4 *example_i) const { return example_i[idx]; } }; struct example_float { typedef sycl::float4 data_type; sycl::float4 foo()(int idx, sycl::float4 *example_i) const { return example_i[idx]; } }; template <typename T> void example_kernel(sycl::nd_item<3> item_ct1, typename T::data_type *example_f) { ... T example_v; /* DPCT1083 */ float j = example_v.foo(idx, example_f).x(); }

Suggestions to Fix

Code requires manual adjustment.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.