This commit is contained in:
jay-tux 2025-05-04 11:51:44 +02:00
parent dc8b85e3da
commit f7240ebbb5
Signed by: jay-tux
GPG Key ID: 84302006B056926E
4 changed files with 32 additions and 18 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# SIMD
*The code powering [simd.jaytux.com](https://simd.jaytux.com)*
This service provides a RESTful API for C/C++ intrinsics, with a slight focus on SIMD intrinsics. The data is currently sourced from [Intel](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#), but I'd like to incorporate AMD performance data, as well as intrinsics from ARM and/or PowerPC.
## Project Structure
- `/api/`: the code powering the API itself (using Ktor in Kotlin);
- `/frontend/`: the code powering the desktop and web frontends (using Compose Multiplatform).
See the respective directories for details on setup/dependencies/building/running.

View File

@ -25,6 +25,8 @@
5. At this point, you are ready to load the data into the database using the application. Run `./gradlew run -reload /path/to/post-processed/data.js /path/to/post-processed/perf2.js` 5. At this point, you are ready to load the data into the database using the application. Run `./gradlew run -reload /path/to/post-processed/data.js /path/to/post-processed/perf2.js`
6. Finally, you can start the application using `./gradlew run` 6. Finally, you can start the application using `./gradlew run`
You can also use the `./package.sh` script to build a standalone executable (with bundled JVM).You can also use the `./package.sh` script to build a standalone executable (with bundled JVM). It uses the Gradle `shadowJar` target together with `jpackage`.
## Running ## Running
By default, the application runs on port `42024`. You can start it using `./gradlew run`. By default, the application runs on port `42024`. You can start it using `./gradlew run`.

View File

@ -1,18 +1,20 @@
This is a Kotlin Multiplatform project targeting Web, Desktop. # Intrinsics UI
*The UI powering [https://simd.jaytux.com](https://simd.jaytux.com)*
* `/composeApp` is for code that will be shared across your Compose Multiplatform applications. ## Running
It contains several subfolders: The Gradle wrapper (`./gradlew`) in the repository can be used to run the project.
- `commonMain` is for code thats common for all targets. Currently, two targets are available:
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. - **Web**: The web application uses Kotlin's WASM/JS target and is "optimized" for landscape mode. I am planning to add a portrait mode in the future (together with an Android/iOS version). There are three important Gradle tasks:
For example, if you want to use Apples CoreCrypto for the iOS part of your Kotlin app, - `wasmJsBrowserRun`: runs the web application (mostly used for development);
`iosMain` would be the right folder for such calls. - `wasmJsBrowserDistribution`: builds a distribution of the web application, which can be statically served;
- `wasmJsBrowserProductionWebpack`: builds a production-ready web application, which can be statically served (this target takes a lot longer to build, but should be more performant/smaller in code size).
- **Desktop/JVM**: The desktop application uses Kotlin's JVM target. It has a few important Gradle tasks:
- `desktopRun`: runs the desktop application (mostly used for development);
- `packageAppImage`, `packageDeb`, `packageDmg`, `packageMsi`: packages the desktop application for distribution on various platforms (Linux, MacOS, Windows).
The web distribution can be found in `composeApp/build/dist/wasmJs`, and the desktop distribution in `composeApp/build/compose/binaries/main/app`.
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html), You can also use the `./package.sh` script to build both (for Desktop, the AppImage will be built). This script also generates a compressed archive (`.tar.gz`) for both.
[Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform/#compose-multiplatform),
[Kotlin/Wasm](https://kotl.in/wasm/)…
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel [#compose-web](https://slack-chats.kotlinlang.org/c/compose-web). ## Configuring
If you face any issues, please report them on [GitHub](https://github.com/JetBrains/compose-multiplatform/issues). The only configuration is the backend URL. At the moment, it is set explicitly in the code, but I might change that. To change it, change the value `com.jaytux.simd.frontend.client.Client.baseUrl` in `/composeApp/src/commonMain/kotlin/com/jaytux/simd/frontend/client/Client.kt`.
You can open the web application by running the `:composeApp:wasmJsBrowserDevelopmentRun` Gradle task.

View File

@ -29,8 +29,8 @@ echo ""
tar -czf simd-frontend@linux.tar.gz -C composeApp/build/compose/binaries/main/app/ com.jaytux.simd.frontend tar -czf simd-frontend@linux.tar.gz -C composeApp/build/compose/binaries/main/app/ com.jaytux.simd.frontend
echo "" echo ""
echo "+----------------------------------------------------------------------------------------+" echo "+--------------------------------------------------------------------------------------------------+"
echo "| tar -czf simd-frontend@web.tar.gz -C composeApp/build/dist/wasmJs productionExecutable |" echo "| tar -czf simd-frontend@web.tar.gz -C composeApp/build/kotlin-webpack/wasmJs productionExecutable |"
echo "+----------------------------------------------------------------------------------------+" echo "+--------------------------------------------------------------------------------------------------+"
echo "" echo ""
tar -czf simd-frontend@web.tar.gz -C composeApp/build/dist/wasmJs productionExecutable tar -czf simd-frontend@web.tar.gz -C composeApp/build/kotlin-webpack/wasmJs productionExecutable