Skip to content

Commit 5b9779b

Browse files
authored
Inform when vector api is present but not used (#3139)
1 parent 6292971 commit 5b9779b

File tree

1 file changed

+12
-2
lines changed
  • worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd

1 file changed

+12
-2
lines changed

worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/SimdSupport.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
import jdk.incubator.vector.ShortVector;
1717
import jdk.incubator.vector.VectorMask;
1818
import jdk.incubator.vector.VectorOperators;
19+
import org.apache.logging.log4j.Logger;
1920

2021
import javax.annotation.Nullable;
2122

2223
public class SimdSupport {
2324

25+
private static final Logger LOGGER = LogManagerCompat.getLogger();
2426
private static final boolean VECTOR_API_PRESENT;
2527

2628
static {
@@ -32,8 +34,16 @@ public class SimdSupport {
3234
}
3335
VECTOR_API_PRESENT = vectorApiPresent;
3436
if (!VECTOR_API_PRESENT && Settings.settings().EXPERIMENTAL.USE_VECTOR_API) {
35-
LogManagerCompat.getLogger()
36-
.warn("FAWE use-vector-api is enabled but --add-modules=jdk.incubator.vector is not set.");
37+
LOGGER.warn("""
38+
FAWE use-vector-api is enabled but --add-modules=jdk.incubator.vector is not set.
39+
Vector instructions will not be used.
40+
""");
41+
} else if (VECTOR_API_PRESENT && !Settings.settings().EXPERIMENTAL.USE_VECTOR_API) {
42+
LOGGER.warn("""
43+
The server is running with the --add-modules=jdk.incubator.vector option.
44+
FAWE can use vector instructions, but it is disabled in the config.
45+
Enable use-vector-api to benefit from vector instructions with FAWE.\
46+
""");
3747
}
3848
}
3949

0 commit comments

Comments
 (0)