Fix SAL annotations for custom op (#11432)

Fix SAL annotations for custom op. For example, "_In_" only applies to pointers, not integers.
This commit is contained in:
Changming Sun 2022-05-04 10:47:28 -07:00 committed by GitHub
parent a1f9847b23
commit 963e1ace4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View file

@ -979,17 +979,17 @@ struct CustomOpApi {
_In_ OrtOpAttrType type,
_Outptr_ OrtOpAttr** op_attr);
void ReleaseOpAttr(_In_ OrtOpAttr* op_attr);
void ReleaseOpAttr(_Frees_ptr_opt_ OrtOpAttr* op_attr);
void CreateOp(_In_ const OrtKernelInfo* info,
_In_ const char* op_name,
_In_ const char* domain,
_In_ int version,
int version,
_In_opt_ const char** type_constraint_names,
_In_opt_ const ONNXTensorElementDataType* type_constraint_values,
_In_opt_ int type_constraint_count,
int type_constraint_count,
_In_opt_ const OrtOpAttr* const* attr_values,
_In_opt_ int attr_count,
int attr_count,
_Outptr_ OrtOp** ort_op);
void InvokeOp(_In_ const OrtKernelContext* context,
@ -999,7 +999,7 @@ struct CustomOpApi {
_Inout_ OrtValue* const* output_values,
_In_ int output_count);
void ReleaseOp(_In_ OrtOp* ort_op);
void ReleaseOp(_Frees_ptr_opt_ OrtOp* ort_op);
private:
const OrtApi& api_;

View file

@ -1221,12 +1221,12 @@ inline void CustomOpApi::ReleaseOpAttr(_Frees_ptr_opt_ OrtOpAttr* op_attr) {
inline void CustomOpApi::CreateOp(_In_ const OrtKernelInfo* info,
_In_ const char* op_name,
_In_ const char* domain,
_In_ int version,
int version,
_In_opt_ const char** type_constraint_names,
_In_opt_ const ONNXTensorElementDataType* type_constraint_values,
_In_opt_ int type_constraint_count,
int type_constraint_count,
_In_opt_ const OrtOpAttr* const* attr_values,
_In_opt_ int attr_count,
int attr_count,
_Outptr_ OrtOp** ort_op) {
ThrowOnError(api_.CreateOp(info, op_name, domain, version, type_constraint_names, type_constraint_values, type_constraint_count, attr_values, attr_count, ort_op));
}

View file

@ -357,12 +357,12 @@ ORT_API_STATUS_IMPL(CreateOp,
_In_ const OrtKernelInfo* info,
_In_ const char* op_name,
_In_ const char* domain,
_In_ int version,
int version,
_In_opt_ const char** type_constraint_names,
_In_opt_ const ONNXTensorElementDataType* type_constraint_values,
_In_opt_ int type_constraint_count,
int type_constraint_count,
_In_opt_ const OrtOpAttr* const* attr_values,
_In_opt_ int attr_count,
int attr_count,
_Outptr_ OrtOp** ort_op);
ORT_API_STATUS_IMPL(InvokeOp,

View file

@ -355,12 +355,12 @@ ORT_API_STATUS_IMPL(OrtApis::CreateOp,
_In_ const OrtKernelInfo* info,
_In_ const char* op_name,
_In_ const char* domain,
_In_ int version,
int version,
_In_opt_ const char** type_constraint_names,
_In_opt_ const ONNXTensorElementDataType* type_constraint_values,
_In_opt_ int type_constraint_count,
int type_constraint_count,
_In_opt_ const OrtOpAttr* const* attr_values,
_In_opt_ int attr_count,
int attr_count,
_Outptr_ OrtOp** ort_op) {
API_IMPL_BEGIN
auto status = onnxruntime::standalone::CreateOp(info,