onnxruntime/samples/c_cxx/opschema_lib_use/main.cc
G. Ramalingam 8079c76383
Create ORT opschema library (#7903)
* Op schema library

* Create ORT opschema library and sample app

* delete message in cmake

* Fix cmake

* Address PR feedback and add dependency

* Add cmake dependency

* Cmake fix

* Add dependency for nsync

* Add dependency for nsync

* Reorder dependencies

* Testing for dependencies on all platforms

* Resolve dependencies on GetStackTrace, floatToHalf

* Compiler strict-aliasing warning

* Merge with master

* Minor cleanup
2021-06-14 14:02:33 -07:00

33 lines
No EOL
838 B
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// A sample/test application using the opschema library of ORT's custom ops.
#include <iostream>
#pragma warning(push)
#pragma warning(disable : 4100)
#include "onnx/defs/schema.h"
#pragma warning(pop)
//
// #include "orttraining/core/graph/training_op_defs.h"
namespace onnxruntime {
extern void RegisterOrtOpSchemas();
}
void Check(const char* domain, int version, const char* opname) {
const onnx::OpSchema* schema = onnx::OpSchemaRegistry::Schema(opname, version, domain);
std::cout << opname << ": " << ((schema != nullptr) ? "Found schema.\n" : "Error: Schema not found.\n");
}
int main() {
onnxruntime::RegisterOrtOpSchemas();
constexpr const char* kMSDomain = "com.microsoft";
Check(kMSDomain, 1, "ReluGrad");
}