]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper.objc : add `-O3 -DNDEBUG` in release mode (#640)
authorJhen-Jie Hong <redacted>
Wed, 22 Mar 2023 20:16:04 +0000 (04:16 +0800)
committerGitHub <redacted>
Wed, 22 Mar 2023 20:16:04 +0000 (22:16 +0200)
examples/whisper.objc/README.md
examples/whisper.objc/whisper.objc.xcodeproj/project.pbxproj
examples/whisper.swiftui/README.md
examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.pbxproj

index ba401098aaece4588a12eff6a0c281f4f41a9ca5..46174d2de85213b7eb83dc97a9436401215a2bcd 100644 (file)
@@ -24,3 +24,5 @@ Also, don't forget to add the `-DGGML_USE_ACCELERATE` compiler flag in Build Pha
 This can significantly improve the performance of the transcription:
 
 <img width="1072" alt="image" src="https://user-images.githubusercontent.com/1991296/208511239-8d7cdbd1-aa48-41b5-becd-ca288d53cc07.png">
+
+In this project, it also added `-O3 -DNDEBUG` to `Other C Flags`, but adding flags to app proj is not ideal in real world (applies to all C/C++ files), consider splitting xcodeproj in workspace in your own project.
index 9a9ee5465c4c676bf589469daaf4e76f0a5949f5..2c93de759d6cbea70b7becb3766e02c80a688592 100644 (file)
                                IPHONEOS_DEPLOYMENT_TARGET = 16.0;
                                MTL_ENABLE_DEBUG_INFO = NO;
                                MTL_FAST_MATH = YES;
+                               OTHER_CFLAGS = (
+                                       "-O3",
+                                       "-DNDEBUG",
+                               );
                                SDKROOT = iphoneos;
                                VALIDATE_PRODUCT = YES;
                        };
index d21b04d98a59ae7e04685de214b5e7c448723840..4db6cd39538fca8fc2ecceacd9ced1b59c7949c6 100644 (file)
@@ -7,8 +7,9 @@ To use:
 2. Add the model to "whisper.swiftui.demo/Resources/models" via Xcode.
 3. Select a sample audio file (for example, [jfk.wav](https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav)).
 4. Add the model to "whisper.swiftui.demo/Resources/samples" via Xcode.
-5. Select the "release" build configuration under "Run", then deploy and run to your device.
+5. Select the "Release" [^2] build configuration under "Run", then deploy and run to your device.
 
 [^1]: I recommend the tiny, base or small models for running on an iOS device.
+[^2]: The `Release` build can boost performance of transcription. In this project, it also added `-O3 -DNDEBUG` to `Other C Flags`, but adding flags to app proj is not ideal in real world (applies to all C/C++ files), consider splitting xcodeproj in workspace in your own project.
 
 ![image](https://user-images.githubusercontent.com/1991296/212539216-0aef65e4-f882-480a-8358-0f816838fd52.png)
index cc0afbcae4ff43b8df46807d7744e5743c9904c4..ab9f6888d59358d9d5767186ecaa9c50cfa6f646 100644 (file)
                                LLVM_LTO = YES;
                                MACOSX_DEPLOYMENT_TARGET = 13.0;
                                MARKETING_VERSION = 1.0;
+                               OTHER_CFLAGS = (
+                                       "-O3",
+                                       "-DNDEBUG",
+                               );
                                PRODUCT_BUNDLE_IDENTIFIER = com.whispercppdemo.WhisperCppDemo;
                                PRODUCT_NAME = "$(TARGET_NAME)";
                                SDKROOT = auto;