Skip to content

Commit 87e36f8

Browse files
Replaced int8_t->std::int8_t, same for other integral types
Added missing `#include <cstdint>`
1 parent 693340b commit 87e36f8

File tree

5 files changed

+34
-33
lines changed

5 files changed

+34
-33
lines changed

dpctl/tensor/libtensor/include/kernels/clip.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class ClipContigFunctor
113113
const std::uint16_t sgSize =
114114
ndit.get_sub_group().get_local_range()[0];
115115
const std::size_t gid = ndit.get_global_linear_id();
116-
const uint16_t nelems_per_sg = sgSize * nelems_per_wi;
116+
const std::uint16_t nelems_per_sg = sgSize * nelems_per_wi;
117117

118118
const std::size_t start =
119119
(gid / sgSize) * (nelems_per_sg - sgSize) + gid;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/conj.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ using ConjStridedFunctor = elementwise_common::
103103
template <typename T> struct ConjOutputType
104104
{
105105
using value_type = typename std::disjunction<
106-
td_ns::TypeMapResultEntry<T, bool, int8_t>,
106+
td_ns::TypeMapResultEntry<T, bool, std::int8_t>,
107107
td_ns::TypeMapResultEntry<T, std::uint8_t>,
108108
td_ns::TypeMapResultEntry<T, std::uint16_t>,
109109
td_ns::TypeMapResultEntry<T, std::uint32_t>,

dpctl/tensor/libtensor/include/utils/type_dispatch_building.hpp

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#pragma once
2727

2828
#include <complex>
29+
#include <cstdint>
2930
#include <type_traits>
3031

3132
#include <sycl/sycl.hpp>
@@ -69,14 +70,14 @@ class DispatchTableBuilder
6970
{
7071
std::vector<funcPtrT> per_dstTy = {
7172
factory<funcPtrT, dstTy, bool>{}.get(),
72-
factory<funcPtrT, dstTy, int8_t>{}.get(),
73-
factory<funcPtrT, dstTy, uint8_t>{}.get(),
74-
factory<funcPtrT, dstTy, int16_t>{}.get(),
75-
factory<funcPtrT, dstTy, uint16_t>{}.get(),
76-
factory<funcPtrT, dstTy, int32_t>{}.get(),
77-
factory<funcPtrT, dstTy, uint32_t>{}.get(),
78-
factory<funcPtrT, dstTy, int64_t>{}.get(),
79-
factory<funcPtrT, dstTy, uint64_t>{}.get(),
73+
factory<funcPtrT, dstTy, std::int8_t>{}.get(),
74+
factory<funcPtrT, dstTy, std::uint8_t>{}.get(),
75+
factory<funcPtrT, dstTy, std::int16_t>{}.get(),
76+
factory<funcPtrT, dstTy, std::uint16_t>{}.get(),
77+
factory<funcPtrT, dstTy, std::int32_t>{}.get(),
78+
factory<funcPtrT, dstTy, std::uint32_t>{}.get(),
79+
factory<funcPtrT, dstTy, std::int64_t>{}.get(),
80+
factory<funcPtrT, dstTy, std::uint64_t>{}.get(),
8081
factory<funcPtrT, dstTy, sycl::half>{}.get(),
8182
factory<funcPtrT, dstTy, float>{}.get(),
8283
factory<funcPtrT, dstTy, double>{}.get(),
@@ -93,24 +94,24 @@ class DispatchTableBuilder
9394
void populate_dispatch_table(funcPtrT table[][_num_types]) const
9495
{
9596
const auto map_by_dst_type = {row_per_dst_type<bool>(),
96-
row_per_dst_type<int8_t>(),
97-
row_per_dst_type<uint8_t>(),
98-
row_per_dst_type<int16_t>(),
99-
row_per_dst_type<uint16_t>(),
100-
row_per_dst_type<int32_t>(),
101-
row_per_dst_type<uint32_t>(),
102-
row_per_dst_type<int64_t>(),
103-
row_per_dst_type<uint64_t>(),
97+
row_per_dst_type<std::int8_t>(),
98+
row_per_dst_type<std::uint8_t>(),
99+
row_per_dst_type<std::int16_t>(),
100+
row_per_dst_type<std::uint16_t>(),
101+
row_per_dst_type<std::int32_t>(),
102+
row_per_dst_type<std::uint32_t>(),
103+
row_per_dst_type<std::int64_t>(),
104+
row_per_dst_type<std::uint64_t>(),
104105
row_per_dst_type<sycl::half>(),
105106
row_per_dst_type<float>(),
106107
row_per_dst_type<double>(),
107108
row_per_dst_type<std::complex<float>>(),
108109
row_per_dst_type<std::complex<double>>()};
109110
assert(map_by_dst_type.size() == _num_types);
110111
int dst_id = 0;
111-
for (auto &row : map_by_dst_type) {
112+
for (const auto &row : map_by_dst_type) {
112113
int src_id = 0;
113-
for (auto &fn_ptr : row) {
114+
for (const auto &fn_ptr : row) {
114115
table[dst_id][src_id] = fn_ptr;
115116
++src_id;
116117
}
@@ -139,22 +140,22 @@ class DispatchVectorBuilder
139140
void populate_dispatch_vector(funcPtrT vector[]) const
140141
{
141142
const auto fn_map_by_type = {func_per_type<bool>(),
142-
func_per_type<int8_t>(),
143-
func_per_type<uint8_t>(),
144-
func_per_type<int16_t>(),
145-
func_per_type<uint16_t>(),
146-
func_per_type<int32_t>(),
147-
func_per_type<uint32_t>(),
148-
func_per_type<int64_t>(),
149-
func_per_type<uint64_t>(),
143+
func_per_type<std::int8_t>(),
144+
func_per_type<std::uint8_t>(),
145+
func_per_type<std::int16_t>(),
146+
func_per_type<std::uint16_t>(),
147+
func_per_type<std::int32_t>(),
148+
func_per_type<std::uint32_t>(),
149+
func_per_type<std::int64_t>(),
150+
func_per_type<std::uint64_t>(),
150151
func_per_type<sycl::half>(),
151152
func_per_type<float>(),
152153
func_per_type<double>(),
153154
func_per_type<std::complex<float>>(),
154155
func_per_type<std::complex<double>>()};
155156
assert(fn_map_by_type.size() == _num_types);
156157
int ty_id = 0;
157-
for (auto &fn : fn_map_by_type) {
158+
for (const auto &fn : fn_map_by_type) {
158159
vector[ty_id] = fn;
159160
++ty_id;
160161
}

dpctl/tensor/libtensor/source/integer_advanced_indexing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ usm_ndarray_take(const dpctl::tensor::usm_ndarray &src,
245245
const py::object &py_ind,
246246
const dpctl::tensor::usm_ndarray &dst,
247247
int axis_start,
248-
uint8_t mode,
248+
std::uint8_t mode,
249249
sycl::queue &exec_q,
250250
const std::vector<sycl::event> &depends)
251251
{
@@ -560,7 +560,7 @@ usm_ndarray_put(const dpctl::tensor::usm_ndarray &dst,
560560
const py::object &py_ind,
561561
const dpctl::tensor::usm_ndarray &val,
562562
int axis_start,
563-
uint8_t mode,
563+
std::uint8_t mode,
564564
sycl::queue &exec_q,
565565
const std::vector<sycl::event> &depends)
566566
{

dpctl/tensor/libtensor/source/integer_advanced_indexing.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ usm_ndarray_take(const dpctl::tensor::usm_ndarray &,
4343
const py::object &,
4444
const dpctl::tensor::usm_ndarray &,
4545
int,
46-
uint8_t,
46+
std::uint8_t,
4747
sycl::queue &,
4848
const std::vector<sycl::event> & = {});
4949

@@ -52,7 +52,7 @@ usm_ndarray_put(const dpctl::tensor::usm_ndarray &,
5252
const py::object &,
5353
const dpctl::tensor::usm_ndarray &,
5454
int,
55-
uint8_t,
55+
std::uint8_t,
5656
sycl::queue &,
5757
const std::vector<sycl::event> & = {});
5858

0 commit comments

Comments
 (0)