Skip to content

Commit affe2db

Browse files
Use C++ std:: qualified fixed width integral types in C++ implementation
1 parent 87e36f8 commit affe2db

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

libsyclinterface/source/dpctl_sycl_queue_interface.cpp

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
#include "dpctl_sycl_device_interface.h"
3232
#include "dpctl_sycl_device_manager.h"
3333
#include "dpctl_sycl_type_casters.hpp"
34+
35+
#include <stddef.h>
36+
#include <stdint.h>
37+
38+
#include <cstdint>
3439
#include <exception>
3540
#include <sstream>
36-
#include <stddef.h>
3741
#include <stdexcept>
3842
#include <sycl/sycl.hpp> /* SYCL headers */
3943
#include <utility>
@@ -45,49 +49,49 @@ using namespace sycl;
4549
switch ((ARGTY)) { \
4650
case DPCTL_INT8_T: \
4751
{ \
48-
auto la = local_accessor<int8_t, NDIM>(R, CGH); \
52+
auto la = local_accessor<std::int8_t, NDIM>(R, CGH); \
4953
CGH.set_arg(IDX, la); \
5054
return true; \
5155
} \
5256
case DPCTL_UINT8_T: \
5357
{ \
54-
auto la = local_accessor<uint8_t, NDIM>(R, CGH); \
58+
auto la = local_accessor<std::uint8_t, NDIM>(R, CGH); \
5559
CGH.set_arg(IDX, la); \
5660
return true; \
5761
} \
5862
case DPCTL_INT16_T: \
5963
{ \
60-
auto la = local_accessor<int16_t, NDIM>(R, CGH); \
64+
auto la = local_accessor<std::int16_t, NDIM>(R, CGH); \
6165
CGH.set_arg(IDX, la); \
6266
return true; \
6367
} \
6468
case DPCTL_UINT16_T: \
6569
{ \
66-
auto la = local_accessor<uint16_t, NDIM>(R, CGH); \
70+
auto la = local_accessor<std::uint16_t, NDIM>(R, CGH); \
6771
CGH.set_arg(IDX, la); \
6872
return true; \
6973
} \
7074
case DPCTL_INT32_T: \
7175
{ \
72-
auto la = local_accessor<int32_t, NDIM>(R, CGH); \
76+
auto la = local_accessor<std::int32_t, NDIM>(R, CGH); \
7377
CGH.set_arg(IDX, la); \
7478
return true; \
7579
} \
7680
case DPCTL_UINT32_T: \
7781
{ \
78-
auto la = local_accessor<uint32_t, NDIM>(R, CGH); \
82+
auto la = local_accessor<std::uint32_t, NDIM>(R, CGH); \
7983
CGH.set_arg(IDX, la); \
8084
return true; \
8185
} \
8286
case DPCTL_INT64_T: \
8387
{ \
84-
auto la = local_accessor<int64_t, NDIM>(R, CGH); \
88+
auto la = local_accessor<std::int64_t, NDIM>(R, CGH); \
8589
CGH.set_arg(IDX, la); \
8690
return true; \
8791
} \
8892
case DPCTL_UINT64_T: \
8993
{ \
90-
auto la = local_accessor<uint64_t, NDIM>(R, CGH); \
94+
auto la = local_accessor<std::uint64_t, NDIM>(R, CGH); \
9195
CGH.set_arg(IDX, la); \
9296
return true; \
9397
} \
@@ -119,8 +123,8 @@ using namespace dpctl::syclinterface;
119123

120124
typedef struct complex
121125
{
122-
uint64_t real;
123-
uint64_t imag;
126+
std::uint64_t real;
127+
std::uint64_t imag;
124128
} complexNumber;
125129

126130
void set_dependent_events(handler &cgh,
@@ -177,28 +181,28 @@ bool set_kernel_arg(handler &cgh,
177181

178182
switch (ArgTy) {
179183
case DPCTL_INT8_T:
180-
cgh.set_arg(idx, *(int8_t *)Arg);
184+
cgh.set_arg(idx, *(std::int8_t *)Arg);
181185
break;
182186
case DPCTL_UINT8_T:
183-
cgh.set_arg(idx, *(uint8_t *)Arg);
187+
cgh.set_arg(idx, *(std::uint8_t *)Arg);
184188
break;
185189
case DPCTL_INT16_T:
186-
cgh.set_arg(idx, *(int16_t *)Arg);
190+
cgh.set_arg(idx, *(std::int16_t *)Arg);
187191
break;
188192
case DPCTL_UINT16_T:
189-
cgh.set_arg(idx, *(uint16_t *)Arg);
193+
cgh.set_arg(idx, *(std::uint16_t *)Arg);
190194
break;
191195
case DPCTL_INT32_T:
192-
cgh.set_arg(idx, *(int32_t *)Arg);
196+
cgh.set_arg(idx, *(std::int32_t *)Arg);
193197
break;
194198
case DPCTL_UINT32_T:
195-
cgh.set_arg(idx, *(uint32_t *)Arg);
199+
cgh.set_arg(idx, *(std::uint32_t *)Arg);
196200
break;
197201
case DPCTL_INT64_T:
198-
cgh.set_arg(idx, *(int64_t *)Arg);
202+
cgh.set_arg(idx, *(std::int64_t *)Arg);
199203
break;
200204
case DPCTL_UINT64_T:
201-
cgh.set_arg(idx, *(uint64_t *)Arg);
205+
cgh.set_arg(idx, *(std::uint64_t *)Arg);
202206
break;
203207
case DPCTL_FLOAT32_T:
204208
cgh.set_arg(idx, *(float *)Arg);

0 commit comments

Comments
 (0)