Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5602b91
[668]: Push down arithmetics into fill operation for EWAdd
May 21, 2025
5526966
[668]: Only store 1 variable of the FillOp. Add TODO for updating docs.
May 22, 2025
94326b2
[668]: Marks FillOp as pure operation. Removes manual operation remov…
May 22, 2025
2481db5
[668]: adds lit based mlir test case for pushdown arithmetics
May 22, 2025
e8c0d07
[668]: use argument names to access fill operation arguments
May 22, 2025
977a8fc
[668]: adds fill rewrite for EwSubOp,EwMulOp,EwDivOp based on EwAddOp…
Jun 5, 2025
154b829
[668]: adds PushDown for RandomMatrixOp+EwAddOp. Marks RandomMatrix a…
Jun 11, 2025
00e8a49
[668]: extract pushdown logic into seperate functions
Jun 30, 2025
f48c5e4
[668]: enables canonicalization for EwMod, EwLog, EwPow and implement…
Jun 30, 2025
ea21abe
[668]: renames tests to include both operations in filename
Jun 30, 2025
8f7ef5d
[668]: remove broken test for FillEwLog and adds tests for RandEwAdd
Jun 30, 2025
ce39cd8
[668]: Adds pushdown arithmetics for Rand + EwMul,EwDiv,EwSub,EwPow
Jun 30, 2025
ca81ae2
[668]: Enables Pushdown for Rand and Fill with EwLog
Jun 30, 2025
1d0f3cb
[668]: fix swapped height and with on fill pushdown
Jul 1, 2025
b763e81
[668]: add scripts test cases for fill EwAdd, EwSub
Jul 1, 2025
d12cb46
[668]: adds more tests for binaryOp Fill pushdown
Jul 1, 2025
86b6b6d
[668]: adds tests for pushdown in rand function
Jul 1, 2025
e97a919
[668]: removes cases for function (matrix) on rhs of binary op
Jul 1, 2025
d0767bb
[668]: removes comments now reflected in tests
Jul 1, 2025
6362f4e
[668]: updates distributed_4 test to have two different istantiations…
Jul 1, 2025
b058378
[668]: removes unused variable. Sets correct type for new EwLog Opera…
Jul 1, 2025
8cbc2cb
[668]: updates rand pushdown mlir tests
Jul 2, 2025
b621259
[668]: adds pushdown for fill operation with unary arithmetics
Jul 3, 2025
f6e6dec
[668]: adds pushdown for randMatrix operation and unary arithmetics
Jul 3, 2025
c3abdf4
[668]: disable incorrect random ewAbs pushdown
Jul 3, 2025
39981c3
[668]: adds test cases for seq operation pushdown. seq + div seems to…
Jul 3, 2025
976a8bc
[668]: fix Fill + Sub pushdown test results
Jul 3, 2025
7065f40
[668]: enables pushdown for seq operation and add,sub,mul,div
Jul 3, 2025
72e3213
[668]: refactor Canonicalizations into template methods
Jul 12, 2025
ada17d6
[668]: renames script test files to not reference internal details
Jul 12, 2025
d188bc2
[668]: adds Traits to handle the different combinations of Operations…
Jul 12, 2025
4805bb9
[668]: removes nonlinear rand pushdowns and updates the special randA…
Jul 12, 2025
23787cc
[668]: removes unused test cases as rand does not support non linear …
Jul 12, 2025
a56073a
[668]: fixes tests, removes seqEwDiv which is not suitable for pushDo…
Jul 13, 2025
43cbc81
[668: fixes width and height confusion on rand + unary/binary pushdown
Jul 25, 2025
8e39be1
[668]: makes sure rand and ewAbs work when mix = max, makes sure the …
Jul 26, 2025
b6f1d19
[668]: remove pushdown for rand + EwMul/EwDiv if the range delimiters…
Jul 26, 2025
87c43f3
[668]: fixes seq with EwDiv pushdown and adds more tests for it
Jul 26, 2025
573ef68
[668]: removes superfluous PushDown trait
Jul 26, 2025
c14f8a9
[668]: removes intermediate tryPushDown method to reduce code complexity
Jul 26, 2025
a92a27f
[668]: activates pushdown for EwMinus
Jul 26, 2025
8dfca70
[668]: renames trait PushDownWithIntervalUpdate to PushDownIncrementU…
Jul 26, 2025
58f19f9
[668]: replace create and replaceOp with replaceOpWithNewOp()
Jul 26, 2025
31b30c7
[668]: update MR to work with changes from b55d1a88358196f8070622cf6a…
Aug 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
377 changes: 345 additions & 32 deletions src/ir/daphneir/Canonicalize.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ir/daphneir/Daphne.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ BoolOrUnknown stringToBoolOrUnknown(const std::string &str);
#include <ir/daphneir/DaphneInferSparsityOpInterface.h>
#include <ir/daphneir/DaphneInferSymmetricOpInterface.h>
#include <ir/daphneir/DaphneInferTypesOpInterface.h>
#include <ir/daphneir/DaphnePushDownTraits.h>

#include <string>
#include <utility>
Expand Down
50 changes: 34 additions & 16 deletions src/ir/daphneir/DaphneOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include "ir/daphneir/DaphneInferSparsityOpInterface.td"
include "ir/daphneir/DaphneInferSparsityTraits.td"
include "ir/daphneir/DaphneInferTypesOpInterface.td"
include "ir/daphneir/DaphneInferTypesTraits.td"
include "ir/daphneir/DaphnePushDownTraits.td"
include "ir/daphneir/DaphneVectorizableOpInterface.td"
include "ir/daphneir/DaphneTypeAdaptationTraits.td"
include "ir/daphneir/CUDASupport.td"
Expand Down Expand Up @@ -119,7 +120,7 @@ def Daphne_ConvertCSRMatrixToRowOffsetsMemRef : Daphne_Op<"convertCSRMatrixToRow

def Daphne_FillOp : Daphne_Op<"fill", [
DataTypeMat, ValueTypeFromFirstArg,
NumRowsFromIthScalar<1>, NumColsFromIthScalar<2>, CUDASupport,
NumRowsFromIthScalar<1>, NumColsFromIthScalar<2>, CUDASupport, Pure,
DeclareOpInterfaceMethods<InferSymmetricOpInterface>
]> {
let arguments = (ins AnyScalar:$arg, Size:$numRows, Size:$numCols);
Expand Down Expand Up @@ -157,7 +158,7 @@ def Daphne_DiagMatrixOp : Daphne_Op<"diagMatrix", [
def Daphne_RandMatrixOp : Daphne_Op<"randMatrix", [
TypesMatchWith<"min and max arguments must be of the same type", "min", "max", "$_self">,
NumRowsFromIthScalar<0>, NumColsFromIthScalar<1>, DeclareOpInterfaceMethods<InferTypesOpInterface>,
SparsityFromIthScalar<4>, CastArgsToResTypeRandMatrixOp
SparsityFromIthScalar<4>, CastArgsToResTypeRandMatrixOp, Pure
]> {
let arguments = (ins Size:$numRows, Size:$numCols, AnyScalar:$min, AnyScalar:$max, F64:$sparsity, IntScalar:$seed);
let results = (outs MatrixOrU:$res);
Expand All @@ -175,7 +176,8 @@ def Daphne_SeqOp : Daphne_Op<"seq", [
DataTypeMat, ValueTypeFromArgs,
OneCol, DeclareOpInterfaceMethods<InferNumRowsOpInterface>,
CompletelyDense,
CastArgsToResType
CastArgsToResType,
Pure
]> {
let arguments = (ins NumScalar:$from, NumScalar:$to, NumScalar:$inc);
let results = (outs MatrixOf<[NumScalar]>);
Expand Down Expand Up @@ -254,15 +256,25 @@ class Daphne_EwUnaryOp<string name, Type scalarType, list<Trait> traits = []> :
// ----------------------------------------------------------------------------

// TODO EwMinusOp: Should an unsigned integer argument yield a signed integer result?
def Daphne_EwMinusOp : Daphne_EwUnaryOp<"ewMinus", NumScalar, [ValueTypeFromFirstArg]> {
def Daphne_EwMinusOp : Daphne_EwUnaryOp<"ewMinus", NumScalar, [ValueTypeFromFirstArg,PushDownLinear]> {
let hasFolder = 1;
let hasCanonicalizeMethod = 1;
}
def Daphne_EwAbsOp : Daphne_EwUnaryOp<"ewAbs", NumScalar, [ValueTypeFromFirstArg]>;
def Daphne_EwSignOp : Daphne_EwUnaryOp<"ewSign", NumScalar, [ValueTypeFromFirstArg]>;
def Daphne_EwExpOp : Daphne_EwUnaryOp<"ewExp", NumScalar, [ValueTypeFromArgsFP]>;
def Daphne_EwLnOp : Daphne_EwUnaryOp<"ewLn", NumScalar, [ValueTypeFromArgsFP]>;
def Daphne_EwSqrtOp : Daphne_EwUnaryOp<"ewSqrt", NumScalar, [ValueTypeFromArgsFP, DeclareOpInterfaceMethods<VectorizableOpInterface>]>;
def Daphne_EwAbsOp : Daphne_EwUnaryOp<"ewAbs", NumScalar, [ValueTypeFromFirstArg]>{
let hasCanonicalizeMethod = 1;
}
def Daphne_EwSignOp : Daphne_EwUnaryOp<"ewSign", NumScalar, [ValueTypeFromFirstArg]>{
let hasCanonicalizeMethod = 1;
}
def Daphne_EwExpOp : Daphne_EwUnaryOp<"ewExp", NumScalar, [ValueTypeFromArgsFP]>{
let hasCanonicalizeMethod = 1;
}
def Daphne_EwLnOp : Daphne_EwUnaryOp<"ewLn", NumScalar, [ValueTypeFromArgsFP]>{
let hasCanonicalizeMethod = 1;
}
def Daphne_EwSqrtOp : Daphne_EwUnaryOp<"ewSqrt", NumScalar, [ValueTypeFromArgsFP, DeclareOpInterfaceMethods<VectorizableOpInterface>]>{
let hasCanonicalizeMethod = 1;
}

// ----------------------------------------------------------------------------
// Logical
Expand Down Expand Up @@ -334,21 +346,27 @@ class Daphne_EwBinaryOp<string name, Type scalarType, list<Trait> traits = []>
// ----------------------------------------------------------------------------

// TODO Make EwAddOp Commutative again (see #449).
def Daphne_EwAddOp : Daphne_EwBinaryOp<"ewAdd", AnyScalar, [ValueTypeFromArgs, CastArgsToResType/*, Commutative*/, EwSparseIfBoth, CUDASupport]> {
def Daphne_EwAddOp : Daphne_EwBinaryOp<"ewAdd", AnyScalar, [ValueTypeFromArgs, CastArgsToResType/*, Commutative*/, EwSparseIfBoth, CUDASupport, PushDownLinear]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwSubOp : Daphne_EwBinaryOp<"ewSub", NumScalar, [ValueTypeFromArgs, CastArgsToResType, EwSparseIfBoth, CUDASupport, PushDownLinear]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwMulOp : Daphne_EwBinaryOp<"ewMul", NumScalar, [ValueTypeFromArgs, CastArgsToResType, Commutative, EwSparseIfEither, CUDASupport, PushDownLinear, PushDownIncrementUpdate]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwDivOp : Daphne_EwBinaryOp<"ewDiv", NumScalar, [ValueTypeFromArgs, CastArgsToResType, CUDASupport, PushDownLinear, PushDownIncrementUpdate]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwSubOp : Daphne_EwBinaryOp<"ewSub", NumScalar, [ValueTypeFromArgs, CastArgsToResType, EwSparseIfBoth, CUDASupport]> {
def Daphne_EwPowOp : Daphne_EwBinaryOp<"ewPow", NumScalar, [ValueTypeFromArgs, CastArgsToResType, CUDASupport]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwMulOp : Daphne_EwBinaryOp<"ewMul", NumScalar, [ValueTypeFromArgs, CastArgsToResType, Commutative, EwSparseIfEither, CUDASupport]> {
def Daphne_EwModOp : Daphne_EwBinaryOp<"ewMod", NumScalar, [ValueTypeFromArgs, CastArgsToResType]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwDivOp : Daphne_EwBinaryOp<"ewDiv", NumScalar, [ValueTypeFromArgs, CastArgsToResType, CUDASupport]> {
def Daphne_EwLogOp : Daphne_EwBinaryOp<"ewLog", NumScalar, [ValueTypeFromArgsFP, CastArgsToResType]> {
let hasCanonicalizeMethod = 1;
}
def Daphne_EwPowOp : Daphne_EwBinaryOp<"ewPow", NumScalar, [ValueTypeFromArgs, CastArgsToResType, CUDASupport]>;
def Daphne_EwModOp : Daphne_EwBinaryOp<"ewMod", NumScalar, [ValueTypeFromArgs, CastArgsToResType]>;
def Daphne_EwLogOp : Daphne_EwBinaryOp<"ewLog", NumScalar, [ValueTypeFromArgsFP, CastArgsToResType]>;

// ----------------------------------------------------------------------------
// Min/max
Expand Down
24 changes: 24 additions & 0 deletions src/ir/daphneir/DaphnePushDownTraits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef SRC_IR_DAPHNEIR_DAPHNEPUSHDOWNTRAITS_H
#define SRC_IR_DAPHNEIR_DAPHNEPUSHDOWNTRAITS_H

namespace mlir::OpTrait {

// ============================================================================
// Traits determining advanced push-down rewrite possibilities
// ============================================================================

/**
* @brief This trait is for operations that are linear and might allow for push-downs into functions that
* act on e.g. ranges
*/
template <class ConcreteOp> class PushDownLinear : public TraitBase<ConcreteOp, PushDownLinear> {};

/**
* @brief This trait is for operations that are using an increment value which
* needs to be accounted for during push-down optimizations
*/
template <class ConcreteOp> class PushDownIncrementUpdate : public TraitBase<ConcreteOp, PushDownIncrementUpdate> {};

} // namespace mlir::OpTrait

#endif // SRC_IR_DAPHNEIR_DAPHNEPUSHDOWNTRAITS_H
29 changes: 29 additions & 0 deletions src/ir/daphneir/DaphnePushDownTraits.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2025 The DAPHNE Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef SRC_IR_DAPHNEIR_DAPHNEPUSHDOWNTRAITS_TD
#define SRC_IR_DAPHNEIR_DAPHNEPUSHDOWNTRAITS_TD

include "mlir/IR/OpBase.td"

// ============================================================================
// Traits determining pushdown rewrite possibilities
// ============================================================================

def PushDownLinear: NativeOpTrait<"PushDownLinear">;
def PushDownIncrementUpdate: NativeOpTrait<"PushDownIncrementUpdate">;

#endif //SRC_IR_DAPHNEIR_DAPHNEPUSHDOWNTRAITS_TD
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ set(TEST_SOURCES
api/cli/codegen/TransposeTest.cpp

ir/daphneir/InferTypesTest.cpp
ir/daphneir/PushdownArithmetics.cpp
api/cli/operations/CanonicalizationConstantFoldingOpTest.cpp
api/cli/operations/CanonicalizationPushDownTest.cpp

parser/config/ConfigParserTest.cpp

Expand Down
4 changes: 2 additions & 2 deletions test/api/cli/distributed/distributed_4.daphne
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
m1 = rand(10, 10, 0.0, 20.0, 1.0, 1);
m2 = rand(10, 10, 0.0, 20.0, 1.0, 1);
print(m1 @ m2);
m2 = rand(10, 10, 0.0, 30.0, 1.0, 1);
print(m1 @ m2);
61 changes: 61 additions & 0 deletions test/api/cli/operations/CanonicalizationPushDownTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2021 The DAPHNE Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <api/cli/Utils.h>

#include <tags.h>

#include <catch.hpp>

#include <sstream>
#include <string>

const std::string dirPath = "test/api/cli/operations/";

#define MAKE_TEST_CASE(name, count) \
TEST_CASE(name, TAG_OPERATIONS) { \
for (unsigned i = 1; i <= count; i++) { \
DYNAMIC_SECTION(name "_" << i << ".daphne") { compareDaphneToRefSimple(dirPath, name, i); } \
} \
}

// These tests simply ensure that basic functionality stays
// functional after pushdown optimizations are performed.
// Check the dedicated "pushdown_arithmetics" testcase for more in depth testing
// of the canonicalizations.
MAKE_TEST_CASE("fillEwAdd", 2)
MAKE_TEST_CASE("fillEwSub", 2)
MAKE_TEST_CASE("fillEwMul", 2)
MAKE_TEST_CASE("fillEwDiv", 2)
MAKE_TEST_CASE("fillEwPow", 2)
MAKE_TEST_CASE("fillEwMod", 2)
MAKE_TEST_CASE("fillEwLog", 2)
MAKE_TEST_CASE("fillEwAbs", 2)
MAKE_TEST_CASE("fillEwSign", 2)
MAKE_TEST_CASE("fillEwExp", 2)
MAKE_TEST_CASE("fillEwLn", 1)
MAKE_TEST_CASE("fillEwSqrt", 1)
MAKE_TEST_CASE("fillEwMinus", 2)
MAKE_TEST_CASE("randEwAdd", 2)
MAKE_TEST_CASE("randEwSub", 1)
MAKE_TEST_CASE("randEwMul", 3)
MAKE_TEST_CASE("randEwDiv", 3)
MAKE_TEST_CASE("randEwAbs", 3)
MAKE_TEST_CASE("randEwMinus", 3)
MAKE_TEST_CASE("seqEwAdd", 2)
MAKE_TEST_CASE("seqEwSub", 2)
MAKE_TEST_CASE("seqEwMul", 3)
MAKE_TEST_CASE("seqEwDiv", 3)
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwAbs_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fillIntermediate = fill(-3,3,3);
result = abs(fillIntermediate);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwAbs_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, int64_t)
3 3 3
3 3 3
3 3 3
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwAbs_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fillIntermediate = fill(3,3,3);
result = abs(fillIntermediate);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwAbs_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, int64_t)
3 3 3
3 3 3
3 3 3
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwAdd_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = fill(1,3,3) + 3;

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwAdd_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, int64_t)
4 4 4
4 4 4
4 4 4
2 changes: 2 additions & 0 deletions test/api/cli/operations/fillEwAdd_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
result = 2 + fill(1.0,2,2);
print(result);
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwAdd_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DenseMatrix(2x2, double)
3 3
3 3
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwDiv_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = fill(12.3,2,3) / 3;

print(result);
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwDiv_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DenseMatrix(2x3, double)
4.1 4.1 4.1
4.1 4.1 4.1
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwDiv_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = fill(12,3,2) / 3;

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwDiv_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x2, int64_t)
4 4
4 4
4 4
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwExp_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fillIntermediate = fill(3,3,3);
result = exp(fillIntermediate);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwExp_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, double)
20.0855 20.0855 20.0855
20.0855 20.0855 20.0855
20.0855 20.0855 20.0855
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwExp_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fillIntermediate = fill(-3,3,3);
result = exp(fillIntermediate);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwExp_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, double)
0.0497871 0.0497871 0.0497871
0.0497871 0.0497871 0.0497871
0.0497871 0.0497871 0.0497871
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwLn_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fillIntermediate = fill(3,3,3);
result = ln(fillIntermediate);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwLn_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, double)
1.09861 1.09861 1.09861
1.09861 1.09861 1.09861
1.09861 1.09861 1.09861
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwLog_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = fill(8,3,3);
result = log(a,2);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwLog_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, double)
3 3 3
3 3 3
3 3 3
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwLog_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = fill(16.0,3,3);
result = log(a,2);

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwLog_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, double)
4 4 4
4 4 4
4 4 4
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMinus_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = - fill(3,2,3);

print(result);
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMinus_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DenseMatrix(2x3, int64_t)
-3 -3 -3
-3 -3 -3
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMinus_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = - fill(-3,2,3);

print(result);
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMinus_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DenseMatrix(2x3, int64_t)
3 3 3
3 3 3
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMod_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = mod(fill(33,2,2),5);

print(result);
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMod_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DenseMatrix(2x2, int64_t)
3 3
3 3
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMod_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = fill(33.0,2,2) % 5;

print(result);
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMod_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DenseMatrix(2x2, double)
3 3
3 3
3 changes: 3 additions & 0 deletions test/api/cli/operations/fillEwMul_1.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result = fill(1,3,3) * 3;

print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwMul_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, int64_t)
3 3 3
3 3 3
3 3 3
2 changes: 2 additions & 0 deletions test/api/cli/operations/fillEwMul_2.daphne
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
result = fill(2.1,3,3) * 4;
print(result);
4 changes: 4 additions & 0 deletions test/api/cli/operations/fillEwMul_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DenseMatrix(3x3, double)
8.4 8.4 8.4
8.4 8.4 8.4
8.4 8.4 8.4
Loading
Loading