Skip to content

Commit

Permalink
Maintenance update May 11. 2021.
Browse files Browse the repository at this point in the history
Additionally:
 - D fast is removed from the tests (it doesn't work with the new test suite: etcimon/fast#19 and it's most
 likely it's not going to be fixed);
 - Java (ND4J) test has been fixed to use the same algorithms as other tests;
 - Some merge issues have been resolved.
  • Loading branch information
nuald committed May 12, 2021
1 parent c6a3897 commit 63977d6
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 375 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Layout/SpaceAroundMethodCallOperator:

Style/ExponentialNotation:
Enabled: true
EnforcedStyle: engineering

Style/SlicingWithRange:
Enabled: true
Expand Down
505 changes: 250 additions & 255 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion brainfuck/bf2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fun verify() {

val pRight = Printer(true)
for (c in "Hello World!\n") {
pRight.print(c.toInt())
pRight.print(c.code)
}
val right = pRight.getChecksum()
if (left != right) {
Expand Down
2 changes: 1 addition & 1 deletion common/commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ COMMON_FLAGS := -march=native -flto -Wa,-mbranches-within-32B-boundaries
GCC_FLAGS := -Wall -O3 $(COMMON_FLAGS)
CLANG_FLAGS := -Wall -O3 $(COMMON_FLAGS)
LIBNOTIFY_FLAGS := -I../common/libnotify ../common/libnotify/target/libnotify.a
NIM_FLAGS := -d:danger --verbosity:0 --opt:speed --hints:off --passC:"$(COMMON_FLAGS)" --passL:"$(COMMON_FLAGS)"
NIM_FLAGS := -d:danger --verbosity:0 --opt:speed --hints:off --passC:"$(COMMON_FLAGS)" --passL:"-march=native -flto"
RUSTC_FLAGS := -C opt-level=3 -C target-cpu=native -C llvm-args=--x86-branches-within-32B-boundaries
VALAC_FLAGS := --disable-assert -X -O3 -X -march=native -X -flto -X -Wa,-mbranches-within-32B-boundaries --pkg gio-2.0 --pkg posix
V_FLAGS := -prod
Expand Down
18 changes: 0 additions & 18 deletions json/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ executables := \
target/json_d \
target/json_d_gdc \
target/json_d_ldc \
target/json_d_gdc_fast \
target/json_d_mir_asdf \
target/json_d_mir_ion \
target/json_nim_gcc \
Expand Down Expand Up @@ -160,23 +159,6 @@ $(nlohmann_json): | target
target/json_nlohmann_json_cpp: test_nlohmann_json.cpp | $(nlohmann_json) $(boost) libnotify
$(GCC_CPP_BUILD) -I$(nlohmann_json)/single_include -I$(boost)

fast-dir := target/fast
$(fast-dir): | target
$(GIT_CLONE) "https://github.com/mleise/fast.git" $@

target/json_d_gdc_fast: test_fast.d | $(fast-dir) $(dfmt)
$(GDC_BUILD) \
$(fast-dir)/source/fast/cstring.d \
$(fast-dir)/source/fast/buffer.d \
$(fast-dir)/source/fast/json.d \
$(fast-dir)/source/fast/parsing.d \
$(fast-dir)/source/fast/intmath.d \
$(fast-dir)/source/fast/internal/sysdef.di \
$(fast-dir)/source/fast/internal/helpers.d \
$(fast-dir)/source/fast/unicode.d \
$(fast-dir)/source/fast/internal/unicode_tables.d \
$(fast-dir)/source/std/simd.d

rapidjson-dir := target/rapidjson
$(rapidjson-dir): | target
$(GIT_CLONE) "https://github.com/miloyip/rapidjson.git" $@
Expand Down
2 changes: 1 addition & 1 deletion json/generate_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
524_288.times do
h = {
'x' => rand * -10e-30,
'y' => rand * 10e+30,
'y' => rand * 10e30,
'z' => rand,
'name' => "#{('a'..'z').to_a.sample(6).join} #{rand(10_000)}",
'opts' => { '1' => [1, true] }
Expand Down
86 changes: 0 additions & 86 deletions json/test_fast.d

This file was deleted.

10 changes: 5 additions & 5 deletions matmul/java-nd4j/src/main/java/bench/matmulnd4j.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

final class matmulnd4j {

private static INDArray matgen(final int n) {
private static INDArray matgen(final int n, final double seed) {
final var idxs = Nd4j.linspace(DataType.DOUBLE, 0, n, 1);
final var iIdxs = idxs.reshape(n,1);
final var jIdxs = idxs.reshape(1, n);

return (iIdxs.sub(jIdxs)).muli((iIdxs.add(jIdxs))).muli(1.0 / n / n);
return (iIdxs.sub(jIdxs)).muli((iIdxs.add(jIdxs))).muli(seed / n / n);
}

private static void notify(final String msg) {
Expand All @@ -27,8 +27,8 @@ private static void notify(final String msg) {

private static double calc(final int n) {
final var size = n / 2 * 2;
final var a = matgen(size);
final var b = matgen(size);
final var a = matgen(size, 1.0);
final var b = matgen(size, 2.0);
final var x = Nd4j.matmul(a, b);
return x.getDouble(size / 2, size / 2);
}
Expand All @@ -37,7 +37,7 @@ public static void main(String[] args) {
final var n = args.length > 0 ? Integer.valueOf(args[0]) : 100;

final var left = calc(101);
final var right = -9.34;
final var right = -18.67;
if (Math.abs(left - right) > 0.5) {
System.err.printf("%f != %f\n", left, right);
System.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion matmul/matmul_d_lubeck.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env dub
/+dub.sdl:
dependency "lubeck" version="~>1.3.4"
dependency "lubeck" version="~>1.3.5"
libs "lapack" "blas"
targetPath "target"
+/
Expand Down
3 changes: 0 additions & 3 deletions primes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ target/primes_scala.jar: primes.scala | target
target/Primes.class: Primes.java | target
$(JAVAC_BUILD)

target/primes_cpp: primes.cpp | target libnotify
$(GCC_CPP_BUILD)

target/primes_rs: primes.rs | target
$(RUSTC_BUILD)

Expand Down
4 changes: 0 additions & 4 deletions primes/primes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ function find(upperBound, prefix) {

let [queue, result] = [[[head, strPrefix]], []]
while (queue.length > 0) {
<<<<<<< HEAD
const [top, prefix] = queue.pop();
=======
let [top, prefix] = queue.pop();
>>>>>>> 3e9376e30656952760a44f1126a36c01e38fa2b7
if (top.terminal) {
result.push(toInt(prefix));
}
Expand Down

0 comments on commit 63977d6

Please sign in to comment.