forked from mindspore-Ecosystem/mindspore
ios demo
This commit is contained in:
parent
8f3455cceb
commit
5051f00bed
|
@ -0,0 +1,431 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
4E3C6FB72764985E00BFE4F8 /* mindspore-lite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E3C6FB62764985E00BFE4F8 /* mindspore-lite.framework */; };
|
||||
4E3C6FBB2764989900BFE4F8 /* test_model.ms.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4E3C6FB82764989900BFE4F8 /* test_model.ms.bin */; };
|
||||
4E3C6FBC2764989900BFE4F8 /* test_model.ms.out in Resources */ = {isa = PBXBuildFile; fileRef = 4E3C6FB92764989900BFE4F8 /* test_model.ms.out */; };
|
||||
4E3C6FBD2764989900BFE4F8 /* test_model.ms in Resources */ = {isa = PBXBuildFile; fileRef = 4E3C6FBA2764989900BFE4F8 /* test_model.ms */; };
|
||||
4E492F322605D4DC003AA9B6 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E492F312605D4DC003AA9B6 /* SceneDelegate.m */; };
|
||||
4E492F352605D4DC003AA9B6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E492F342605D4DC003AA9B6 /* ViewController.m */; };
|
||||
4E492F382605D4DC003AA9B6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4E492F362605D4DC003AA9B6 /* Main.storyboard */; };
|
||||
4E492F3A2605D4DE003AA9B6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4E492F392605D4DE003AA9B6 /* Assets.xcassets */; };
|
||||
4E492F3D2605D4DE003AA9B6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4E492F3B2605D4DE003AA9B6 /* LaunchScreen.storyboard */; };
|
||||
4E492F402605D4DE003AA9B6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E492F3F2605D4DE003AA9B6 /* main.m */; };
|
||||
4E492F4B2605D58F003AA9B6 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4E492F472605D58F003AA9B6 /* AppDelegate.mm */; };
|
||||
4E8D9A972612F60B00C7FBC1 /* Benchmark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4E492F482605D58F003AA9B6 /* Benchmark.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXBuildRule section */
|
||||
4ED51573262D21EA00CC8DA0 /* PBXBuildRule */ = {
|
||||
isa = PBXBuildRule;
|
||||
compilerSpec = com.apple.compilers.proxy.script;
|
||||
fileType = sourcecode.metal;
|
||||
inputFiles = (
|
||||
);
|
||||
isEditable = 1;
|
||||
outputFiles = (
|
||||
);
|
||||
script = "# metal\n";
|
||||
};
|
||||
/* End PBXBuildRule section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
4E3C6FB62764985E00BFE4F8 /* mindspore-lite.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = "mindspore-lite.framework"; sourceTree = "<group>"; };
|
||||
4E3C6FB82764989900BFE4F8 /* test_model.ms.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; name = test_model.ms.bin; path = ../model/test_model.ms.bin; sourceTree = "<group>"; };
|
||||
4E3C6FB92764989900BFE4F8 /* test_model.ms.out */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = test_model.ms.out; path = ../model/test_model.ms.out; sourceTree = "<group>"; };
|
||||
4E3C6FBA2764989900BFE4F8 /* test_model.ms */ = {isa = PBXFileReference; lastKnownFileType = file; name = test_model.ms; path = ../model/test_model.ms; sourceTree = "<group>"; };
|
||||
4E492F2A2605D4DC003AA9B6 /* mindspore-lite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mindspore-lite.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4E492F2D2605D4DC003AA9B6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
4E492F302605D4DC003AA9B6 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
|
||||
4E492F312605D4DC003AA9B6 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
|
||||
4E492F332605D4DC003AA9B6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
4E492F342605D4DC003AA9B6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
4E492F372605D4DC003AA9B6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
4E492F392605D4DE003AA9B6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
4E492F3C2605D4DE003AA9B6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
4E492F3E2605D4DE003AA9B6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
4E492F3F2605D4DE003AA9B6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
4E492F472605D58F003AA9B6 /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
|
||||
4E492F482605D58F003AA9B6 /* Benchmark.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Benchmark.cpp; sourceTree = "<group>"; };
|
||||
4E492F492605D58F003AA9B6 /* Benchmark.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Benchmark.hpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
4E492F272605D4DC003AA9B6 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4E3C6FB72764985E00BFE4F8 /* mindspore-lite.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
4E492F212605D4DC003AA9B6 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4E3C6FBA2764989900BFE4F8 /* test_model.ms */,
|
||||
4E3C6FB82764989900BFE4F8 /* test_model.ms.bin */,
|
||||
4E3C6FB92764989900BFE4F8 /* test_model.ms.out */,
|
||||
4E492F2C2605D4DC003AA9B6 /* mindspore-lite */,
|
||||
4E492F2B2605D4DC003AA9B6 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4E492F2B2605D4DC003AA9B6 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4E492F2A2605D4DC003AA9B6 /* mindspore-lite.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4E492F2C2605D4DC003AA9B6 /* mindspore-lite */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4E3C6FB62764985E00BFE4F8 /* mindspore-lite.framework */,
|
||||
4E492F472605D58F003AA9B6 /* AppDelegate.mm */,
|
||||
4E492F482605D58F003AA9B6 /* Benchmark.cpp */,
|
||||
4E492F492605D58F003AA9B6 /* Benchmark.hpp */,
|
||||
4E492F2D2605D4DC003AA9B6 /* AppDelegate.h */,
|
||||
4E492F302605D4DC003AA9B6 /* SceneDelegate.h */,
|
||||
4E492F312605D4DC003AA9B6 /* SceneDelegate.m */,
|
||||
4E492F332605D4DC003AA9B6 /* ViewController.h */,
|
||||
4E492F342605D4DC003AA9B6 /* ViewController.m */,
|
||||
4E492F362605D4DC003AA9B6 /* Main.storyboard */,
|
||||
4E492F392605D4DE003AA9B6 /* Assets.xcassets */,
|
||||
4E492F3B2605D4DE003AA9B6 /* LaunchScreen.storyboard */,
|
||||
4E492F3E2605D4DE003AA9B6 /* Info.plist */,
|
||||
4E492F3F2605D4DE003AA9B6 /* main.m */,
|
||||
);
|
||||
path = "mindspore-lite";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
4E492F292605D4DC003AA9B6 /* mindspore-lite */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 4E492F432605D4DE003AA9B6 /* Build configuration list for PBXNativeTarget "mindspore-lite" */;
|
||||
buildPhases = (
|
||||
4E492F262605D4DC003AA9B6 /* Sources */,
|
||||
4E492F272605D4DC003AA9B6 /* Frameworks */,
|
||||
4E492F282605D4DC003AA9B6 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
4ED51573262D21EA00CC8DA0 /* PBXBuildRule */,
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "mindspore-lite";
|
||||
productName = "mindspore-lite";
|
||||
productReference = 4E492F2A2605D4DC003AA9B6 /* mindspore-lite.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
4E492F222605D4DC003AA9B6 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1140;
|
||||
ORGANIZATIONNAME = mindspore;
|
||||
TargetAttributes = {
|
||||
4E492F292605D4DC003AA9B6 = {
|
||||
CreatedOnToolsVersion = 11.4.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 4E492F252605D4DC003AA9B6 /* Build configuration list for PBXProject "mindspore-lite" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 4E492F212605D4DC003AA9B6;
|
||||
productRefGroup = 4E492F2B2605D4DC003AA9B6 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
4E492F292605D4DC003AA9B6 /* mindspore-lite */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
4E492F282605D4DC003AA9B6 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4E492F3D2605D4DE003AA9B6 /* LaunchScreen.storyboard in Resources */,
|
||||
4E492F3A2605D4DE003AA9B6 /* Assets.xcassets in Resources */,
|
||||
4E3C6FBB2764989900BFE4F8 /* test_model.ms.bin in Resources */,
|
||||
4E3C6FBC2764989900BFE4F8 /* test_model.ms.out in Resources */,
|
||||
4E492F382605D4DC003AA9B6 /* Main.storyboard in Resources */,
|
||||
4E3C6FBD2764989900BFE4F8 /* test_model.ms in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
4E492F262605D4DC003AA9B6 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4E492F352605D4DC003AA9B6 /* ViewController.m in Sources */,
|
||||
4E492F402605D4DE003AA9B6 /* main.m in Sources */,
|
||||
4E492F4B2605D58F003AA9B6 /* AppDelegate.mm in Sources */,
|
||||
4E492F322605D4DC003AA9B6 /* SceneDelegate.m in Sources */,
|
||||
4E8D9A972612F60B00C7FBC1 /* Benchmark.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
4E492F362605D4DC003AA9B6 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
4E492F372605D4DC003AA9B6 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4E492F3B2605D4DE003AA9B6 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
4E492F3C2605D4DE003AA9B6 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
4E492F412605D4DE003AA9B6 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_CPP_STATIC_DESTRUCTORS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
VALID_ARCHS = "arm64 arm64e armv7 armv7s x86_64";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
4E492F422605D4DE003AA9B6 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_CPP_STATIC_DESTRUCTORS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VALID_ARCHS = "arm64 arm64e armv7 armv7s x86_64";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
4E492F442605D4DE003AA9B6 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_CPP_STATIC_DESTRUCTORS = NO;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEVELOPMENT_TEAM = B6BQP4K5VM;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/mindspore-lite",
|
||||
);
|
||||
FRAMEWORK_VERSION = C;
|
||||
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
|
||||
INFOPLIST_EXPAND_BUILD_SETTINGS = YES;
|
||||
INFOPLIST_FILE = "mindspore-lite/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
OTHER_LDFLAGS = "-all_load";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "mindspore.mindspore-lite";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = NO;
|
||||
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
|
||||
SYSTEM_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/mindspore-lite/mindspore-lite.framework/Headers";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/mindspore-lite/mindspore-lite.framework/Headers";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VALID_ARCHS = arm64;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
4E492F452605D4DE003AA9B6 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_CPP_STATIC_DESTRUCTORS = NO;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEVELOPMENT_TEAM = B6BQP4K5VM;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/mindspore-lite",
|
||||
);
|
||||
FRAMEWORK_VERSION = C;
|
||||
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
|
||||
INFOPLIST_EXPAND_BUILD_SETTINGS = YES;
|
||||
INFOPLIST_FILE = "mindspore-lite/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
OTHER_LDFLAGS = "-all_load";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "mindspore.mindspore-lite";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = NO;
|
||||
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
|
||||
SYSTEM_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/mindspore-lite/mindspore-lite.framework/Headers";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/mindspore-lite/mindspore-lite.framework/Headers";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VALID_ARCHS = arm64;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
4E492F252605D4DC003AA9B6 /* Build configuration list for PBXProject "mindspore-lite" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4E492F412605D4DE003AA9B6 /* Debug */,
|
||||
4E492F422605D4DE003AA9B6 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
4E492F432605D4DE003AA9B6 /* Build configuration list for PBXNativeTarget "mindspore-lite" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4E492F442605D4DE003AA9B6 /* Debug */,
|
||||
4E492F452605D4DE003AA9B6 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 4E492F222605D4DC003AA9B6 /* Project object */;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:mindspore-lite.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildSystemType</key>
|
||||
<string>Original</string>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array/>
|
||||
</plist>
|
Binary file not shown.
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildLocationStyle</key>
|
||||
<string>UseAppPreferences</string>
|
||||
<key>CustomBuildLocationType</key>
|
||||
<string>RelativeToDerivedData</string>
|
||||
<key>DerivedDataLocationStyle</key>
|
||||
<string>Default</string>
|
||||
<key>IssueFilterStyle</key>
|
||||
<string>ShowActiveSchemeOnly</string>
|
||||
<key>LiveSourceIssuesEnabled</key>
|
||||
<true/>
|
||||
<key>ShowSharedSchemesAutomaticallyEnabled</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
uuid = "53AAC513-AE02-4DEC-A4AC-3DA79619CDC1"
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
<Breakpoints>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "77B10317-9494-41D4-99F2-EED5A59E064C"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "mindspore-lite/Benchmark.cpp"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "18"
|
||||
endingLineNumber = "18"
|
||||
landmarkName = "unknown"
|
||||
landmarkType = "0">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "C201D4EB-89D9-43E4-B350-56A4E598BCD9"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "mindspore-lite/cpu.cpp"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "22"
|
||||
endingLineNumber = "22"
|
||||
landmarkName = "unknown"
|
||||
landmarkType = "0">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>mindspore-lite.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#include "Benchmark.hpp"
|
||||
@interface AppDelegate ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// Override point for customization after application launch.
|
||||
mindspore::lite::main_benchmark();
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UISceneSession lifecycle
|
||||
|
||||
|
||||
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
|
||||
}
|
||||
|
||||
|
||||
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
|
||||
|
||||
@end
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "83.5x83.5"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
|
@ -0,0 +1,273 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef BENCHMARK_H_
|
||||
#define BENCHMARK_H_
|
||||
|
||||
#include <getopt.h>
|
||||
#include <csignal>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <cfloat>
|
||||
#include <random>
|
||||
#include <utility>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "mindspore-lite/include/model.h"
|
||||
#include "mindspore-lite/include/lite_session.h"
|
||||
#include "mindspore-lite/include/errorcode.h"
|
||||
|
||||
constexpr float kNumRelativeTolerance = 1e-5;
|
||||
constexpr float kNumAbsoluteTolerance = 1e-8;
|
||||
constexpr float kNumMinAbsoluteError = 1e-5;
|
||||
constexpr float kNumDefaultLoopCount = 10;
|
||||
constexpr float kNumDefaultNumThread = 2;
|
||||
constexpr float kNumDefaultWarmUpLoopCount = 3;
|
||||
constexpr float kNumDefaultAccuracyThreshold = 0.5;
|
||||
constexpr float kNumDefaultPrintLen = 50;
|
||||
constexpr float kNumPercentage = 100;
|
||||
constexpr float kNumMinMeanError = 0.0000001;
|
||||
|
||||
enum InDataType { kImage = 0, kBinary = 1 };
|
||||
namespace mindspore::lite {
|
||||
#ifdef ENABLE_ARM64
|
||||
struct PerfResult {
|
||||
int64_t nr;
|
||||
struct {
|
||||
int64_t value;
|
||||
int64_t id;
|
||||
} values[2];
|
||||
};
|
||||
struct PerfCount {
|
||||
int64_t value[2];
|
||||
};
|
||||
#endif
|
||||
|
||||
struct CheckTensor {
|
||||
CheckTensor(const std::vector<size_t> &shape, const std::vector<float> &data,
|
||||
const std::vector<std::string> &strings_data = {""}) {
|
||||
this->shape = shape;
|
||||
this->data = data;
|
||||
this->strings_data = strings_data;
|
||||
}
|
||||
std::vector<size_t> shape;
|
||||
std::vector<float> data;
|
||||
std::vector<std::string> strings_data;
|
||||
};
|
||||
|
||||
struct Flag {
|
||||
std::string model_file_;
|
||||
std::string in_data_file_;
|
||||
std::vector<std::string> input_data_list_;
|
||||
InDataType in_data_type_ = kBinary;
|
||||
std::string in_data_type_in_ = "bin";
|
||||
int cpu_bind_mode_ = HIGHER_CPU;
|
||||
// MarkPerformance
|
||||
int loop_count_ = kNumDefaultLoopCount;
|
||||
int num_threads_ = kNumDefaultNumThread;
|
||||
bool enable_fp16_ = false;
|
||||
int warm_up_loop_count_ = kNumDefaultWarmUpLoopCount;
|
||||
// MarkAccuracy
|
||||
std::string benchmark_data_file_;
|
||||
std::string benchmark_data_type_ = "FLOAT";
|
||||
float accuracy_threshold_ = kNumDefaultAccuracyThreshold;
|
||||
// Resize
|
||||
std::string resize_dims_in_;
|
||||
std::vector<std::vector<int>> resize_dims_;
|
||||
|
||||
std::string device_ = "CPU";
|
||||
bool time_profiling_ = false;
|
||||
bool perf_profiling_ = false;
|
||||
std::string perf_event_ = "CYCLE";
|
||||
bool dump_profiling_ = false;
|
||||
};
|
||||
|
||||
class Benchmark {
|
||||
public:
|
||||
explicit Benchmark(Flag *flag) : flags_(flag) {}
|
||||
|
||||
virtual ~Benchmark();
|
||||
|
||||
int Init();
|
||||
int RunBenchmark();
|
||||
|
||||
private:
|
||||
// call GenerateInputData or ReadInputFile to init inputTensors
|
||||
int LoadInput();
|
||||
|
||||
// call GenerateRandomData to fill inputTensors
|
||||
int GenerateInputData();
|
||||
|
||||
int GenerateRandomData(size_t size, void *data, TypeId data_type);
|
||||
|
||||
int ReadInputFile();
|
||||
|
||||
int ReadCalibData();
|
||||
|
||||
int ReadTensorData(std::ifstream &in_file_stream, const std::string &tensor_name, const std::vector<size_t> &dims);
|
||||
|
||||
int CompareOutput();
|
||||
|
||||
tensor::MSTensor *GetTensorByNameOrShape(const std::string &node_or_tensor_name, const std::vector<size_t> &dims);
|
||||
|
||||
tensor::MSTensor *GetTensorByNodeShape(const std::vector<size_t> &node_shape);
|
||||
|
||||
int CompareStringData(const std::string &name, tensor::MSTensor *tensor);
|
||||
|
||||
int CompareDataGetTotalBiasAndSize(const std::string &name, tensor::MSTensor *tensor, float *total_bias,
|
||||
int *total_size);
|
||||
|
||||
int InitCallbackParameter();
|
||||
|
||||
int InitTimeProfilingCallbackParameter();
|
||||
|
||||
int InitPerfProfilingCallbackParameter();
|
||||
|
||||
int InitDumpProfilingCallbackParameter();
|
||||
|
||||
int PrintResult(const std::vector<std::string> &title, const std::map<std::string, std::pair<int, float>> &result);
|
||||
|
||||
void InitContext(const std::shared_ptr<Context> &context);
|
||||
|
||||
#ifdef ENABLE_ARM64
|
||||
int PrintPerfResult(const std::vector<std::string> &title,
|
||||
const std::map<std::string, std::pair<int, struct PerfCount>> &result);
|
||||
#endif
|
||||
|
||||
int PrintInputData();
|
||||
|
||||
// tensorData need to be converter first
|
||||
template <typename T>
|
||||
float CompareData(const std::string &nodeName, const std::vector<int> &msShape, const void *tensor_data) {
|
||||
const T *msTensorData = static_cast<const T *>(tensor_data);
|
||||
auto iter = this->benchmark_data_.find(nodeName);
|
||||
if (iter != this->benchmark_data_.end()) {
|
||||
std::vector<size_t> castedMSShape;
|
||||
size_t shapeSize = 1;
|
||||
for (int64_t dim : msShape) {
|
||||
castedMSShape.push_back(size_t(dim));
|
||||
shapeSize *= dim;
|
||||
}
|
||||
|
||||
CheckTensor *calibTensor = iter->second;
|
||||
if (calibTensor->shape != castedMSShape) {
|
||||
std::cout << "Shape of mslite output(";
|
||||
for (auto dim : castedMSShape) {
|
||||
std::cout << dim << ",";
|
||||
}
|
||||
std::cout << ") and shape source model output(";
|
||||
for (auto dim : calibTensor->shape) {
|
||||
std::cout << dim << ",";
|
||||
}
|
||||
std::cout << ") are different";
|
||||
return RET_ERROR;
|
||||
}
|
||||
size_t errorCount = 0;
|
||||
float meanError = 0;
|
||||
std::cout << "Data of node " << nodeName << " : ";
|
||||
for (size_t j = 0; j < shapeSize; j++) {
|
||||
if (j < kNumDefaultPrintLen) {
|
||||
std::cout << static_cast<float>(msTensorData[j]) << " ";
|
||||
}
|
||||
|
||||
if (std::isnan(msTensorData[j]) || std::isinf(msTensorData[j])) {
|
||||
std::cerr << "Output tensor has nan or inf data, compare fail" << std::endl;
|
||||
return RET_ERROR;
|
||||
}
|
||||
|
||||
auto tolerance = kNumAbsoluteTolerance + kNumRelativeTolerance * fabs(calibTensor->data.at(j));
|
||||
auto absoluteError = std::fabs(msTensorData[j] - calibTensor->data.at(j));
|
||||
if (absoluteError > tolerance) {
|
||||
if (fabs(calibTensor->data.at(j) - 0.0f) < FLT_EPSILON) {
|
||||
if (absoluteError > kNumMinAbsoluteError) {
|
||||
meanError += absoluteError;
|
||||
errorCount++;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// just assume that atol = rtol
|
||||
meanError += absoluteError / (fabs(calibTensor->data.at(j)) + FLT_MIN);
|
||||
errorCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
if (meanError > 0.0f) {
|
||||
meanError /= errorCount;
|
||||
}
|
||||
|
||||
if (meanError <= kNumMinMeanError) {
|
||||
std::cout << "Mean bias of node/tensor " << nodeName << " : 0%" << std::endl;
|
||||
} else {
|
||||
std::cout << "Mean bias of node/tensor " << nodeName << " : " << meanError * kNumPercentage << "%" << std::endl;
|
||||
}
|
||||
return meanError;
|
||||
} else {
|
||||
std::cout << "%s is not in Source Model output" << nodeName.c_str();
|
||||
return RET_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, typename Distribution>
|
||||
void FillInputData(int size, void *data, Distribution distribution) {
|
||||
assert(data != nullptr);
|
||||
int elements_num = size / sizeof(T);
|
||||
(void)std::generate_n(static_cast<T *>(data), elements_num,
|
||||
[&]() { return static_cast<T>(distribution(random_engine_)); });
|
||||
}
|
||||
|
||||
int MarkPerformance();
|
||||
|
||||
int MarkAccuracy();
|
||||
|
||||
private:
|
||||
struct Flag *flags_;
|
||||
session::LiteSession *session_{nullptr};
|
||||
std::vector<mindspore::tensor::MSTensor *> ms_inputs_;
|
||||
std::unordered_map<std::string, std::vector<mindspore::tensor::MSTensor *>> ms_outputs_;
|
||||
std::unordered_map<std::string, CheckTensor *> benchmark_data_;
|
||||
std::unordered_map<std::string, TypeId> data_type_map_{{"FLOAT", TypeId::kNumberTypeFloat},
|
||||
{"INT8", TypeId::kNumberTypeInt8},
|
||||
{"INT32", TypeId::kNumberTypeInt32},
|
||||
{"UINT8", TypeId::kNumberTypeUInt8}};
|
||||
TypeId msCalibDataType = TypeId::kNumberTypeFloat;
|
||||
|
||||
// callback parameters
|
||||
uint64_t op_begin_ = 0;
|
||||
int op_call_times_total_ = 0;
|
||||
float op_cost_total_ = 0.0f;
|
||||
std::map<std::string, std::pair<int, float>> op_times_by_type_;
|
||||
std::map<std::string, std::pair<int, float>> op_times_by_name_;
|
||||
#ifdef ENABLE_ARM64
|
||||
int perf_fd = 0;
|
||||
int perf_fd2 = 0;
|
||||
float op_cost2_total_ = 0.0f;
|
||||
std::map<std::string, std::pair<int, struct PerfCount>> op_perf_by_type_;
|
||||
std::map<std::string, std::pair<int, struct PerfCount>> op_perf_by_name_;
|
||||
#endif
|
||||
KernelCallBack before_call_back_ = nullptr;
|
||||
KernelCallBack after_call_back_ = nullptr;
|
||||
std::mt19937 random_engine_;
|
||||
};
|
||||
int RunBenchmark(Flag *flags);
|
||||
int main_benchmark();
|
||||
} // namespace mindspore::lite
|
||||
#endif // MINNIE_BENCHMARK_BENCHMARK_H_
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>SceneDelegate</string>
|
||||
<key>UISceneStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array/>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>
|
||||
|
||||
@property(strong, nonatomic)UIWindow * window;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "SceneDelegate.h"
|
||||
|
||||
@interface SceneDelegate ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation SceneDelegate
|
||||
|
||||
|
||||
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
}
|
||||
|
||||
|
||||
- (void)sceneDidDisconnect:(UIScene *)scene {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
|
||||
- (void)sceneDidBecomeActive:(UIScene *)scene {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
|
||||
- (void)sceneWillResignActive:(UIScene *)scene {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
|
||||
- (void)sceneWillEnterForeground:(UIScene *)scene {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
|
||||
- (void)sceneDidEnterBackground:(UIScene *)scene {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
}
|
||||
|
||||
|
||||
@end
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ViewController : UIViewController
|
||||
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "ViewController.h"
|
||||
|
||||
@interface ViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
@end
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* Copyright 2021 Huawei Technologies Co., Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "AppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
NSString * appDelegateClassName;
|
||||
@autoreleasepool {
|
||||
// Setup code that might create autoreleased objects goes here.
|
||||
appDelegateClassName = NSStringFromClass([AppDelegate class]);
|
||||
}
|
||||
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
|
||||
}
|
Loading…
Reference in New Issue