Skip to content

Commit ba8a391

Browse files
committed
Respond to comments
- Check that TensorDim < 3 using yaml returns: . - Rename some things and remove copypasta
1 parent 72935f1 commit ba8a391

File tree

9 files changed

+104
-78
lines changed

9 files changed

+104
-78
lines changed

include/ur_api.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9585,7 +9585,7 @@ urEnqueueNativeCommandExp(
95859585
#if !defined(__GNUC__)
95869586
#pragma endregion
95879587
#endif
9588-
// Intel 'oneAPI' Unified Runtime Experimental API for enqueuing work through native APIs
9588+
// Intel 'oneAPI' Unified Runtime Experimental API for mapping tensor objects
95899589
#if !defined(__GNUC__)
95909590
#pragma region tensor map(experimental)
95919591
#endif
@@ -9706,6 +9706,8 @@ typedef enum ur_exp_tensor_map_oob_fill_flag_t {
97069706
/// + `NULL == PixelBoxUpperCorner`
97079707
/// + `NULL == ElementStrides`
97089708
/// + `NULL == hTensorMap`
9709+
/// - ::UR_RESULT_ERROR_INVALID_ARGUMENT
9710+
/// + `TensorRank < 3`
97099711
UR_APIEXPORT ur_result_t UR_APICALL
97109712
urTensorMapEncodeIm2ColExp(
97119713
ur_device_handle_t hDevice, ///< [in] Handle of the device object.
@@ -9715,18 +9717,18 @@ urTensorMapEncodeIm2ColExp(
97159717
const uint64_t *GlobalDim, ///< [in] Array containing tensor size (number of elements) along each of
97169718
///< the TensorRank dimensions.
97179719
const uint64_t *GlobalStrides, ///< [in] Array containing stride size (in bytes) along each of the
9718-
///< tensorRank - 1 dimensions.
9720+
///< TensorRank - 1 dimensions.
97199721
const int *PixelBoxLowerCorner, ///< [in] Array containing DHW dimensions of lower box corner.
97209722
const int *PixelBoxUpperCorner, ///< [in] Array containing DHW dimensions of upper box corner.
97219723
uint32_t ChannelsPerPixel, ///< [in] Number of channels per pixel.
97229724
uint32_t PixelsPerColumn, ///< [in] Number of pixels per column.
9723-
const uint32_t *ElementStrides, ///< [in] Array containing traversal stride in each of the tensorRank
9725+
const uint32_t *ElementStrides, ///< [in] Array containing traversal stride in each of the TensorRank
97249726
///< dimensions.
97259727
ur_exp_tensor_map_interleave_flags_t Interleave, ///< [in] Type of interleaved layout the tensor addresses
97269728
ur_exp_tensor_map_swizzle_flags_t Swizzle, ///< [in] Bank swizzling pattern inside shared memory
97279729
ur_exp_tensor_map_l2_promotion_flags_t L2Promotion, ///< [in] L2 promotion size.
9728-
ur_exp_tensor_map_oob_fill_flags_t OobFill, ///< [in] Indicate whether zero or special NaN constant will be used to
9729-
///< fill out-of-bound elements.
9730+
ur_exp_tensor_map_oob_fill_flags_t OobFill, ///< [in] Indicates whether zero or special NaN constant will be used to
9731+
///< fill out-of-bounds elements.
97309732
ur_exp_tensor_map_handle_t *hTensorMap ///< [out] Handle of the tensor map object.
97319733
);
97329734

@@ -9756,6 +9758,8 @@ urTensorMapEncodeIm2ColExp(
97569758
/// + `NULL == BoxDim`
97579759
/// + `NULL == ElementStrides`
97589760
/// + `NULL == hTensorMap`
9761+
/// - ::UR_RESULT_ERROR_INVALID_ARGUMENT
9762+
/// + `TensorRank < 3`
97599763
UR_APIEXPORT ur_result_t UR_APICALL
97609764
urTensorMapEncodeTiledExp(
97619765
ur_device_handle_t hDevice, ///< [in] Handle of the device object.
@@ -9765,17 +9769,17 @@ urTensorMapEncodeTiledExp(
97659769
const uint64_t *GlobalDim, ///< [in] Array containing tensor size (number of elements) along each of
97669770
///< the TensorRank dimensions.
97679771
const uint64_t *GlobalStrides, ///< [in] Array containing stride size (in bytes) along each of the
9768-
///< tensorRank - 1 dimensions.
9772+
///< TensorRank - 1 dimensions.
97699773
const uint32_t *BoxDim, ///< [in] Array containing traversal box size (number of elments) along
9770-
///< each of the tensorRank dimensions. Specifies how many elements to be
9774+
///< each of the TensorRank dimensions. Specifies how many elements to be
97719775
///< traversed along each tensor dimension.
9772-
const uint32_t *ElementStrides, ///< [in] Array containing traversal stride in each of the tensorRank
9776+
const uint32_t *ElementStrides, ///< [in] Array containing traversal stride in each of the TensorRank
97739777
///< dimensions.
97749778
ur_exp_tensor_map_interleave_flags_t Interleave, ///< [in] Type of interleaved layout the tensor addresses
97759779
ur_exp_tensor_map_swizzle_flags_t Swizzle, ///< [in] Bank swizzling pattern inside shared memory
97769780
ur_exp_tensor_map_l2_promotion_flags_t L2Promotion, ///< [in] L2 promotion size.
9777-
ur_exp_tensor_map_oob_fill_flags_t OobFill, ///< [in] Indicate whether zero or special NaN constant will be used to
9778-
///< fill out-of-bound elements.
9781+
ur_exp_tensor_map_oob_fill_flags_t OobFill, ///< [in] Indicates whether zero or special NaN constant will be used to
9782+
///< fill out-of-bounds elements.
97799783
ur_exp_tensor_map_handle_t *hTensorMap ///< [out] Handle of the tensor map object.
97809784
);
97819785

scripts/core/exp-tensor-map.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
--- #--------------------------------------------------------------------------
1111
type: header
12-
desc: "Intel $OneApi Unified Runtime Experimental API for enqueuing work through native APIs"
12+
desc: "Intel $OneApi Unified Runtime Experimental API for mapping tensor objects"
1313
ordinal: "100"
1414

1515
--- #--------------------------------------------------------------------------
@@ -125,7 +125,7 @@ params:
125125
desc: "[in] Array containing tensor size (number of elements) along each of the TensorRank dimensions."
126126
- type: const uint64_t*
127127
name: GlobalStrides
128-
desc: "[in] Array containing stride size (in bytes) along each of the tensorRank - 1 dimensions."
128+
desc: "[in] Array containing stride size (in bytes) along each of the TensorRank - 1 dimensions."
129129
- type: const int*
130130
name: PixelBoxLowerCorner
131131
desc: "[in] Array containing DHW dimensions of lower box corner."
@@ -140,7 +140,7 @@ params:
140140
desc: "[in] Number of pixels per column."
141141
- type: const uint32_t*
142142
name: ElementStrides
143-
desc: "[in] Array containing traversal stride in each of the tensorRank dimensions."
143+
desc: "[in] Array containing traversal stride in each of the TensorRank dimensions."
144144
- type: $x_exp_tensor_map_interleave_flags_t
145145
name: Interleave
146146
desc: "[in] Type of interleaved layout the tensor addresses"
@@ -152,10 +152,13 @@ params:
152152
desc: "[in] L2 promotion size."
153153
- type: $x_exp_tensor_map_oob_fill_flags_t
154154
name: OobFill
155-
desc: "[in] Indicate whether zero or special NaN constant will be used to fill out-of-bound elements."
155+
desc: "[in] Indicates whether zero or special NaN constant will be used to fill out-of-bounds elements."
156156
- type: $x_exp_tensor_map_handle_t*
157157
name: hTensorMap
158158
desc: "[out] Handle of the tensor map object."
159+
returns:
160+
- $X_RESULT_ERROR_INVALID_ARGUMENT:
161+
- "`TensorRank < 3`"
159162

160163
--- #--------------------------------------------------------------------------
161164
type: function
@@ -182,13 +185,13 @@ params:
182185
desc: "[in] Array containing tensor size (number of elements) along each of the TensorRank dimensions."
183186
- type: const uint64_t*
184187
name: GlobalStrides
185-
desc: "[in] Array containing stride size (in bytes) along each of the tensorRank - 1 dimensions."
188+
desc: "[in] Array containing stride size (in bytes) along each of the TensorRank - 1 dimensions."
186189
- type: const uint32_t*
187190
name: BoxDim
188-
desc: "[in] Array containing traversal box size (number of elments) along each of the tensorRank dimensions. Specifies how many elements to be traversed along each tensor dimension."
191+
desc: "[in] Array containing traversal box size (number of elments) along each of the TensorRank dimensions. Specifies how many elements to be traversed along each tensor dimension."
189192
- type: const uint32_t*
190193
name: ElementStrides
191-
desc: "[in] Array containing traversal stride in each of the tensorRank dimensions."
194+
desc: "[in] Array containing traversal stride in each of the TensorRank dimensions."
192195
- type: $x_exp_tensor_map_interleave_flags_t
193196
name: Interleave
194197
desc: "[in] Type of interleaved layout the tensor addresses"
@@ -200,8 +203,11 @@ params:
200203
desc: "[in] L2 promotion size."
201204
- type: $x_exp_tensor_map_oob_fill_flags_t
202205
name: OobFill
203-
desc: "[in] Indicate whether zero or special NaN constant will be used to fill out-of-bound elements."
206+
desc: "[in] Indicates whether zero or special NaN constant will be used to fill out-of-bounds elements."
204207
- type: $x_exp_tensor_map_handle_t*
205208
name: hTensorMap
206209
desc: "[out] Handle of the tensor map object."
210+
returns:
211+
- $X_RESULT_ERROR_INVALID_ARGUMENT:
212+
- "`TensorRank < 3`"
207213

source/adapters/cuda/tensor_map.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ struct ur_exp_tensor_map_handle_t_ {
1818
};
1919

2020
#define CONVERT(URTYPE, CUTYPE) \
21-
if (URTYPE & UrType) \
22-
return CUTYPE;
21+
if ((URTYPE)&UrType) \
22+
return (CUTYPE);
2323

2424
inline CUtensorMapDataType
2525
convertUrToCuDataType(ur_exp_tensor_map_data_type_flags_t UrType) {
@@ -71,7 +71,7 @@ convertUrToCuSwizzle(ur_exp_tensor_map_swizzle_flags_t UrType) {
7171
}
7272

7373
CUtensorMapL2promotion
74-
convertUrToL2promotion(ur_exp_tensor_map_l2_promotion_flags_t UrType) {
74+
convertUrToCuL2Promotion(ur_exp_tensor_map_l2_promotion_flags_t UrType) {
7575
CONVERT(UR_EXP_TENSOR_MAP_L2_PROMOTION_FLAG_NONE,
7676
CU_TENSOR_MAP_L2_PROMOTION_NONE);
7777
CONVERT(UR_EXP_TENSOR_MAP_L2_PROMOTION_FLAG_64B,
@@ -84,7 +84,7 @@ convertUrToL2promotion(ur_exp_tensor_map_l2_promotion_flags_t UrType) {
8484
}
8585

8686
CUtensorMapFloatOOBfill
87-
convertUrToCuOOBfill(ur_exp_tensor_map_oob_fill_flags_t UrType) {
87+
convertUrToCuOobFill(ur_exp_tensor_map_oob_fill_flags_t UrType) {
8888
CONVERT(UR_EXP_TENSOR_MAP_OOB_FILL_FLAG_NONE,
8989
CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE);
9090
CONVERT(UR_EXP_TENSOR_MAP_OOB_FILL_FLAG_REQUEST_ZERO_FMA,
@@ -111,7 +111,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urTensorMapEncodeIm2ColExp(
111111
GlobalAddress, GlobalDim, GlobalStrides, PixelBoxLowerCorner,
112112
PixelBoxUpperCorner, ChannelsPerPixel, PixelsPerColumn, ElementStrides,
113113
convertUrToCuInterleave(Interleave), convertUrToCuSwizzle(Swizzle),
114-
convertUrToL2promotion(L2Promotion), convertUrToCuOOBfill(OobFill)));
114+
convertUrToCuL2Promotion(L2Promotion), convertUrToCuOobFill(OobFill)));
115115
} catch (ur_result_t Err) {
116116
return Err;
117117
}
@@ -134,7 +134,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
134134
&(*hTensorMap)->Map, convertUrToCuDataType(TensorMapType), TensorRank,
135135
GlobalAddress, GlobalDim, GlobalStrides, BoxDim, ElementStrides,
136136
convertUrToCuInterleave(Interleave), convertUrToCuSwizzle(Swizzle),
137-
convertUrToL2promotion(L2Promotion), convertUrToCuOOBfill(OobFill)));
137+
convertUrToCuL2Promotion(L2Promotion), convertUrToCuOobFill(OobFill)));
138138
} catch (ur_result_t Err) {
139139
return Err;
140140
}

source/adapters/null/ur_nullddi.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5919,15 +5919,15 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeIm2ColExp(
59195919
///< the TensorRank dimensions.
59205920
const uint64_t *
59215921
GlobalStrides, ///< [in] Array containing stride size (in bytes) along each of the
5922-
///< tensorRank - 1 dimensions.
5922+
///< TensorRank - 1 dimensions.
59235923
const int *
59245924
PixelBoxLowerCorner, ///< [in] Array containing DHW dimensions of lower box corner.
59255925
const int *
59265926
PixelBoxUpperCorner, ///< [in] Array containing DHW dimensions of upper box corner.
59275927
uint32_t ChannelsPerPixel, ///< [in] Number of channels per pixel.
59285928
uint32_t PixelsPerColumn, ///< [in] Number of pixels per column.
59295929
const uint32_t *
5930-
ElementStrides, ///< [in] Array containing traversal stride in each of the tensorRank
5930+
ElementStrides, ///< [in] Array containing traversal stride in each of the TensorRank
59315931
///< dimensions.
59325932
ur_exp_tensor_map_interleave_flags_t
59335933
Interleave, ///< [in] Type of interleaved layout the tensor addresses
@@ -5936,8 +5936,8 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeIm2ColExp(
59365936
ur_exp_tensor_map_l2_promotion_flags_t
59375937
L2Promotion, ///< [in] L2 promotion size.
59385938
ur_exp_tensor_map_oob_fill_flags_t
5939-
OobFill, ///< [in] Indicate whether zero or special NaN constant will be used to
5940-
///< fill out-of-bound elements.
5939+
OobFill, ///< [in] Indicates whether zero or special NaN constant will be used to
5940+
///< fill out-of-bounds elements.
59415941
ur_exp_tensor_map_handle_t
59425942
*hTensorMap ///< [out] Handle of the tensor map object.
59435943
) try {
@@ -5977,13 +5977,13 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
59775977
///< the TensorRank dimensions.
59785978
const uint64_t *
59795979
GlobalStrides, ///< [in] Array containing stride size (in bytes) along each of the
5980-
///< tensorRank - 1 dimensions.
5980+
///< TensorRank - 1 dimensions.
59815981
const uint32_t *
59825982
BoxDim, ///< [in] Array containing traversal box size (number of elments) along
5983-
///< each of the tensorRank dimensions. Specifies how many elements to be
5983+
///< each of the TensorRank dimensions. Specifies how many elements to be
59845984
///< traversed along each tensor dimension.
59855985
const uint32_t *
5986-
ElementStrides, ///< [in] Array containing traversal stride in each of the tensorRank
5986+
ElementStrides, ///< [in] Array containing traversal stride in each of the TensorRank
59875987
///< dimensions.
59885988
ur_exp_tensor_map_interleave_flags_t
59895989
Interleave, ///< [in] Type of interleaved layout the tensor addresses
@@ -5992,8 +5992,8 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
59925992
ur_exp_tensor_map_l2_promotion_flags_t
59935993
L2Promotion, ///< [in] L2 promotion size.
59945994
ur_exp_tensor_map_oob_fill_flags_t
5995-
OobFill, ///< [in] Indicate whether zero or special NaN constant will be used to
5996-
///< fill out-of-bound elements.
5995+
OobFill, ///< [in] Indicates whether zero or special NaN constant will be used to
5996+
///< fill out-of-bounds elements.
59975997
ur_exp_tensor_map_handle_t
59985998
*hTensorMap ///< [out] Handle of the tensor map object.
59995999
) try {

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7921,15 +7921,15 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeIm2ColExp(
79217921
///< the TensorRank dimensions.
79227922
const uint64_t *
79237923
GlobalStrides, ///< [in] Array containing stride size (in bytes) along each of the
7924-
///< tensorRank - 1 dimensions.
7924+
///< TensorRank - 1 dimensions.
79257925
const int *
79267926
PixelBoxLowerCorner, ///< [in] Array containing DHW dimensions of lower box corner.
79277927
const int *
79287928
PixelBoxUpperCorner, ///< [in] Array containing DHW dimensions of upper box corner.
79297929
uint32_t ChannelsPerPixel, ///< [in] Number of channels per pixel.
79307930
uint32_t PixelsPerColumn, ///< [in] Number of pixels per column.
79317931
const uint32_t *
7932-
ElementStrides, ///< [in] Array containing traversal stride in each of the tensorRank
7932+
ElementStrides, ///< [in] Array containing traversal stride in each of the TensorRank
79337933
///< dimensions.
79347934
ur_exp_tensor_map_interleave_flags_t
79357935
Interleave, ///< [in] Type of interleaved layout the tensor addresses
@@ -7938,8 +7938,8 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeIm2ColExp(
79387938
ur_exp_tensor_map_l2_promotion_flags_t
79397939
L2Promotion, ///< [in] L2 promotion size.
79407940
ur_exp_tensor_map_oob_fill_flags_t
7941-
OobFill, ///< [in] Indicate whether zero or special NaN constant will be used to
7942-
///< fill out-of-bound elements.
7941+
OobFill, ///< [in] Indicates whether zero or special NaN constant will be used to
7942+
///< fill out-of-bounds elements.
79437943
ur_exp_tensor_map_handle_t
79447944
*hTensorMap ///< [out] Handle of the tensor map object.
79457945
) {
@@ -8004,13 +8004,13 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
80048004
///< the TensorRank dimensions.
80058005
const uint64_t *
80068006
GlobalStrides, ///< [in] Array containing stride size (in bytes) along each of the
8007-
///< tensorRank - 1 dimensions.
8007+
///< TensorRank - 1 dimensions.
80088008
const uint32_t *
80098009
BoxDim, ///< [in] Array containing traversal box size (number of elments) along
8010-
///< each of the tensorRank dimensions. Specifies how many elements to be
8010+
///< each of the TensorRank dimensions. Specifies how many elements to be
80118011
///< traversed along each tensor dimension.
80128012
const uint32_t *
8013-
ElementStrides, ///< [in] Array containing traversal stride in each of the tensorRank
8013+
ElementStrides, ///< [in] Array containing traversal stride in each of the TensorRank
80148014
///< dimensions.
80158015
ur_exp_tensor_map_interleave_flags_t
80168016
Interleave, ///< [in] Type of interleaved layout the tensor addresses
@@ -8019,8 +8019,8 @@ __urdlllocal ur_result_t UR_APICALL urTensorMapEncodeTiledExp(
80198019
ur_exp_tensor_map_l2_promotion_flags_t
80208020
L2Promotion, ///< [in] L2 promotion size.
80218021
ur_exp_tensor_map_oob_fill_flags_t
8022-
OobFill, ///< [in] Indicate whether zero or special NaN constant will be used to
8023-
///< fill out-of-bound elements.
8022+
OobFill, ///< [in] Indicates whether zero or special NaN constant will be used to
8023+
///< fill out-of-bounds elements.
80248024
ur_exp_tensor_map_handle_t
80258025
*hTensorMap ///< [out] Handle of the tensor map object.
80268026
) {

0 commit comments

Comments
 (0)