@@ -18,8 +18,11 @@ has the maximum absolute value of all elements in vector ``x`` (real
1818variants), or such that (\| Re(``x[i] ``)\| + \| Im(``x[i] ``)\| ) is maximal
1919(complex variants).
2020
21- If either ``n `` or ``incx `` are not positive, the routine returns
22- ``0 ``.
21+ The index is zero-based if ``base `` is set to ``oneapi::mkl::index_base::zero `` (default)
22+ or one-based if it is set to ``oneapi::mkl::index_base::one ``.
23+
24+ If either ``n `` or ``incx `` is not positive, the routine returns
25+ ``0 ``, regardless of the base of the index selected.
2326
2427If more than one vector element is found with the same largest
2528absolute value, the index of the first one encountered is returned.
@@ -38,13 +41,6 @@ index of the first ``NaN``.
3841 * - ``std::complex<float> ``
3942 * - ``std:complex<double> ``
4043
41- .. container :: Note
42-
43- .. rubric :: Note
44- :class: NoteTipHead
45-
46- The index is zero-based.
47-
4844.. _onemkl_blas_iamax_buffer :
4945
5046iamax (Buffer Version)
@@ -59,7 +55,8 @@ iamax (Buffer Version)
5955 std::int64_t n,
6056 sycl::buffer<T,1> &x,
6157 std::int64_t incx,
62- sycl::buffer<std::int64_t,1> &result)
58+ sycl::buffer<std::int64_t,1> &result,
59+ oneapi::mkl::index_base base = oneapi::mkl::index_base::zero)
6360 }
6461 .. code-block :: cpp
6562
@@ -68,7 +65,8 @@ iamax (Buffer Version)
6865 std::int64_t n,
6966 sycl::buffer<T,1> &x,
7067 std::int64_t incx,
71- sycl::buffer<std::int64_t,1> &result)
68+ sycl::buffer<std::int64_t,1> &result,
69+ oneapi::mkl::index_base base = oneapi::mkl::index_base::zero)
7270 }
7371
7472 .. container :: section
@@ -89,12 +87,16 @@ iamax (Buffer Version)
8987 incx
9088 The stride of vector ``x ``.
9189
90+ base
91+ Indicates how the output value is indexed. If omitted, defaults to zero-based
92+ indexing.
93+
9294.. container :: section
9395
9496 .. rubric :: Output Parameters
9597
9698 result
97- The buffer where the zero-based index ``i `` of the maximal element
99+ The buffer where the index ``i `` of the maximal element
98100 is stored.
99101
100102.. container :: section
@@ -133,6 +135,7 @@ iamax (USM Version)
133135 const T *x,
134136 std::int64_t incx,
135137 std::int64_t *result,
138+ oneapi::mkl::index_base base = oneapi::mkl::index_base::zero,
136139 const std::vector<sycl::event> &dependencies = {})
137140 }
138141 .. code-block :: cpp
@@ -143,6 +146,7 @@ iamax (USM Version)
143146 const T *x,
144147 std::int64_t incx,
145148 std::int64_t *result,
149+ oneapi::mkl::index_base base = oneapi::mkl::index_base::zero,
146150 const std::vector<sycl::event> &dependencies = {})
147151 }
148152
@@ -165,6 +169,10 @@ iamax (USM Version)
165169 incx
166170 The stride of vector ``x ``.
167171
172+ base
173+ Indicates how the output value is indexed. If omitted, defaults to zero-based
174+ indexing.
175+
168176 dependencies
169177 List of events to wait for before starting computation, if any.
170178 If omitted, defaults to no dependencies.
@@ -174,7 +182,7 @@ iamax (USM Version)
174182 .. rubric :: Output Parameters
175183
176184 result
177- The pointer to where the zero-based index ``i `` of the maximal
185+ The pointer to where the index ``i `` of the maximal
178186 element is stored.
179187
180188.. container :: section
0 commit comments