Enable SPM support for Ext and configure pipelines for extensions target testing (#3)

* initial ext files

* add a workable version of spm for extensions

* update

* update pipeline

* update pipelines

* fix dev/release pipelines for extensions pod

* fix dev pipelines for extensions pod

* fix release pipelines for extensions pod

* fix dev  pipelines for extensions pod

* adding empty include folder for configuring extensions target path

* test

* test

* test

* revert pipeline changes

* revert gitignore changes

* add ext pod binary target for release pipeline

* add pipeline for extensions

* update

* update package.swift

* update latest from branch

* update

* fix

* fix

* update

* try dummy empty file

* test

* update package.swift to use fatalerror

* syntax

* try gitignore revert

* update gitignore

* add -list

* onnxruntime-Package

* update using onnxruntime-Package

* update dev pipeline

* fix dev pipelines

* syntax

* pull extensions/

* update pipelines again

* syntax

* variables

* fix

* fix -r

* update Package.swift

* update Package.swift

* minor update

* address pr comments

* minor updates

* fix

* refine messages

* syntax

* syntax again

* address pr comments partial

* address pr comments

* add .h header file and notes

* minor updates

* syncing objc source files and add code to register custom ops using function pointer

* format

* move to the header for function doc

---------

Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
This commit is contained in:
Rachel Guo
2023-08-11 10:07:43 -07:00
committed by GitHub
parent 7acc38c99c
commit c76787fd3e
33 changed files with 1424 additions and 62 deletions
@@ -0,0 +1,14 @@

E
imagebgr_data DecodeImage" DecodeImage:com.microsoft.extensions DecodeImageZ
image

 image_lengthb2
bgr_data&
$

bgr_data_h

bgr_data_w
B
com.microsoft.extensions
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import XCTest
import Foundation
@testable import OnnxRuntimeBindings
@testable import OnnxRuntimeExtensions
final class SwiftOnnxRuntimeExtensionsTests: XCTestCase {
let modelPath: String = Bundle.module.url(forResource: "decode_image", withExtension: "onnx")!.path
func testCreateSessionWithCustomOps() throws {
let env = try ORTEnv(loggingLevel: ORTLoggingLevel.verbose)
let options = try ORTSessionOptions()
try options.setLogSeverityLevel(ORTLoggingLevel.verbose)
try options.setIntraOpNumThreads(1)
// Register Custom Ops library using function pointer
let ortCustomOpsFnPtr = OrtExt.getRegisterCustomOpsFunctionPointer()
try options.registerCustomOps(functionPointer: ortCustomOpsFnPtr)
// Create the ORTSession
_ = try ORTSession(env: env, modelPath: modelPath, sessionOptions: options)
}
}