Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture Upscaling for iOS #805

Merged
merged 1 commit into from
Nov 19, 2022
Merged

Conversation

vkedwardli
Copy link
Collaborator

Didn't know there is actual demand for this feature (requested by MaGi_TekK), so here we go!

  • Use build_ios_openmp.sh to build OpenMP.xcframework (since fat binary by lipo cannot support arm64 iOS + arm64 iPhone Simulator)
  • GitHub runner would only build arm64 (--disableSimulator)
  • Manually linking the static library inside xcframework until CMake can support linking xcframework)

@flyinghead flyinghead merged commit 1995eb9 into flyinghead:master Nov 19, 2022
@knsjoon
Copy link

knsjoon commented Dec 2, 2022

Thank you for the openMP for ios!
I have one question: do I need to change some settings on xcode in order to use openMP? It seems that my code keeps using only one thread..

@vkedwardli
Copy link
Collaborator Author

@knsjoon during the cmake conf phrase, you should be able to see it is trying locate OpenMP, I have added the below message for iOS:

-- Finding OpenMP.xcframework for iOS
-- Could NOT find OpenMP.xcframework, compile it using shell/apple/emulator-ios/OpenMP/build_ios_openmp.sh

then you need to build_ios_openmp.sh first, and run cmake again (when in doubt, clear the build folder)
The generated Xcode project should have linked OpenMP iOS arm version for you now
(I would recommend you to use generate_xcode_project.command)

If you want to play with iPhone Simulator, the library is compiled for x86_64 and arm also, but you have to link it manually

@DarvishKamaliaDL
Copy link

@knsjoon were you ever able to get your app to use more than one thread?

@vkedwardli
Copy link
Collaborator Author

vkedwardli commented May 10, 2023

@DarvishKamaliaDL https://github.com/flyinghead/flycast/actions/runs/4918429105/jobs/8784744043#step:11:30
The latest build is still able to found the OpenMP framework, do you have difficulties linking it?

@DarvishKamaliaDL
Copy link

I was able to link but couldn't get it to use more than one thread until I added -Xclang -fopenmp to the projects Other C Flags. Thanks for building this!

@vkedwardli
Copy link
Collaborator Author

@DarvishKamaliaDL glad that it is working for you, FYR the flag should be set automatically by CMake when OpenMP is detected.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fopenmp")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants