Skip to content

Commit

Permalink
Update 0004-Add-SIMD-utilities.patch
Browse files Browse the repository at this point in the history
Add changes proposed from pufferfish-gg#81
  • Loading branch information
rockfordroeNG authored Mar 7, 2024
1 parent b5f094a commit 8512ded
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0004-Add-SIMD-utilities.patch
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ index deb52c185705c4b4186c7bae02f2a827620c20ca..d1a8bfb29817d2b73689713b4d5f04d7
+ // Attempt to detect vectorization
+ try {
+ SIMDDetection.isEnabled = SIMDDetection.canEnable(PufferfishLogger.LOGGER);
+ SIMDDetection.versionLimited = SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19;
+ SIMDDetection.versionLimited = SIMDDetection.versionLimited = SIMDDetection.getJavaVersion() < 17 || SIMDDetection.getJavaVersion() > 21;
+ } catch (NoClassDefFoundError | Exception ignored) {
+ ignored.printStackTrace();
+ }
+
+ if (SIMDDetection.isEnabled) {
+ PufferfishLogger.LOGGER.info("SIMD operations detected as functional. Will replace some operations with faster versions.");
+ } else if (SIMDDetection.versionLimited) {
+ PufferfishLogger.LOGGER.warning("Will not enable SIMD! These optimizations are only safely supported on Java 17, Java 18, and Java 19.");
+ PufferfishLogger.LOGGER.warning("Will not enable SIMD! These optimizations are only safely supported on Java 17 through Java 21.");
+ } else {
+ PufferfishLogger.LOGGER.warning("SIMD operations are available for your server, but are not configured!");
+ PufferfishLogger.LOGGER.warning("To enable additional optimizations, add \"--add-modules=jdk.incubator.vector\" to your startup flags, BEFORE the \"-jar\".");
Expand Down

0 comments on commit 8512ded

Please sign in to comment.