DPCT1077#

Message#

<macro name> redefines a standard SYCL type, which may cause conflicts.

Detailed Help#

SYCLomatic detected that the code redefines a standard SYCL* type, which may cause conflicts in the included SYCL header files.

Suggestions to Fix#

Rename the macro to avoid conflicts with standard SYCL types.

For example, this original CUDA* code:

 1// test.h
 2inline void bar(cudaDeviceAttr attr) {
 3  ...
 4}
 5
 6// test.cu
 7#define int2 int32_t
 8#include "test.h"
 9
10void foo() {
11  int2 a;
12  ...
13}

results in the following migrated SYCL code:

 1// test.h
 2#include <sycl/sycl.hpp>
 3#include <dpct/dpct.hpp>
 4
 5inline void bar(int attr) {
 6  ...
 7}
 8
 9// test.dp.cpp
10/*
11DPCT1077:0: 'int2' redefines a standard SYCL type, which may cause conflicts.
12*/
13#define int2 int32_t
14#include "test.h"
15
16void foo() {
17  int2 a;
18  ...
19}

which is rewritten to:

 1// test.h
 2#include <sycl/sycl.hpp>
 3#include <dpct/dpct.hpp>
 4
 5inline void bar(int attr) {
 6  ...
 7}
 8
 9// test.dp.cpp
10#include "test.h"
11
12void foo() {
13  int32_t a;
14  ...
15}