DPCT1064#
Message#
Migrated <function name> call is used in a macro/template definition and may not be valid for all macro/template uses. Adjust the code.
Detailed Help#
The warning is generated when the function call is used in a macro definition and needs to be migrated differently, depending on how the macro is called. The SYCLomatic generates code that is valid for one of the calls of the macro, but may not be valid for all calls of this macro in the code.
For example: The function pow
can be migrated to sycl::pow<double>
or
sycl::pown
, depending on the types of parameters passed through macro arguments.
For example, this original CUDA* code:
1#define POW(B, E) pow(B, E)
2__device__ void foo() {
3 double a = POW(2.5, 3.1);
4 double b = POW(2.5, 2);
5}
results in the following migrated SYCL* code:
1/*
2DPCT1064:0: Migrated pow call is used in a macro/template definition and may not
3be valid for all macro/template uses. Adjust the code.
4*/
5#define POW(B, E) dpct::pow(B, E)
6void foo() {
7 double a = POW(2.5, 3.1);
8 double b = POW(2.5, 2);
9}
which is rewritten to:
1void foo() {
2 double a = POW(2.5, 3.1);
3 double b = 2.5 * 2.5;
4}
Suggestions to Fix#
Declare new macros for different use cases of the macro call in the resulting code.