Fixed more stuff
This commit is contained in:
parent
1ea4bf10b4
commit
ec489c911d
|
@ -81,7 +81,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return this; }
|
protected MatrixOpClassification unsafe() { return this; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
protected MatrixOpClassification offset() { return this; }
|
boolean isSafe() { return false; }
|
||||||
|
|
||||||
void execute(
|
void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
|
@ -136,6 +136,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -146,6 +147,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -167,6 +169,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -200,6 +203,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -210,6 +214,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -231,6 +236,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -264,6 +270,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -274,6 +281,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -295,6 +303,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -328,6 +337,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -338,6 +348,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -359,6 +370,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
int sourceStride,
|
int sourceStride,
|
||||||
|
@ -448,6 +460,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -458,6 +471,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int leftSourceStride,
|
int leftSourceStride,
|
||||||
|
@ -486,6 +500,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int leftSourceStride,
|
int leftSourceStride,
|
||||||
|
@ -546,6 +561,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -556,6 +572,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int leftSourceStride,
|
int leftSourceStride,
|
||||||
|
@ -584,6 +601,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int leftSourceStride,
|
int leftSourceStride,
|
||||||
|
@ -643,6 +661,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -653,6 +672,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return this; }
|
protected MatrixOpClassification safe() { return this; }
|
||||||
protected MatrixOpClassification direct() { return this; }
|
protected MatrixOpClassification direct() { return this; }
|
||||||
|
boolean isSafe() { return false; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int leftSourceStride,
|
int leftSourceStride,
|
||||||
|
@ -681,6 +701,7 @@ public final class Math {
|
||||||
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; }
|
||||||
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
protected MatrixOpClassification safe() { return MATRIXOP_SAFE; }
|
||||||
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; }
|
||||||
|
boolean isSafe() { return true; }
|
||||||
native void execute(
|
native void execute(
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int leftSourceStride,
|
int leftSourceStride,
|
||||||
|
@ -830,14 +851,42 @@ public final class Math {
|
||||||
* be safe; otherwise if is direct, then the side where n > 1 must be
|
* be safe; otherwise if is direct, then the side where n > 1 must be
|
||||||
* the destination.
|
* the destination.
|
||||||
*/
|
*/
|
||||||
abstract MatrixOpClassification checkBinaryOp(
|
MatrixOpClassification checkBinaryOp(
|
||||||
int leftSourceElements,
|
int leftSourceElements,
|
||||||
int rightSourceElements,
|
int rightSourceElements,
|
||||||
int leftSourceAddress,
|
int leftSourceAddress,
|
||||||
int rightSourceAddress,
|
int rightSourceAddress,
|
||||||
int destinationAddress
|
int destinationAddress
|
||||||
);
|
) {
|
||||||
|
|
||||||
|
if (leftSourceElements > 1 && rightSourceElements > 1) {
|
||||||
|
if (isSafe())
|
||||||
|
return this;
|
||||||
|
else
|
||||||
|
return MATRIXOP_UNSAFE;
|
||||||
|
} else if (leftSourceElements == 1 && rightSourceElements > 1) {
|
||||||
|
if (isSafe())
|
||||||
|
return this;
|
||||||
|
else if (destinationAddress == rightSourceAddress)
|
||||||
|
return this;
|
||||||
|
else
|
||||||
|
return MATRIXOP_UNSAFE;
|
||||||
|
} else if (rightSourceElements == 1 && leftSourceElements > 1) {
|
||||||
|
if (isSafe())
|
||||||
|
return this;
|
||||||
|
else if (destinationAddress == leftSourceAddress)
|
||||||
|
return this;
|
||||||
|
else
|
||||||
|
return MATRIXOP_UNSAFE;
|
||||||
|
} else {
|
||||||
|
return MATRIXOP_UNSAFE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if this is a safe classification
|
||||||
|
*/
|
||||||
|
abstract boolean isSafe();
|
||||||
|
|
||||||
public final MatrixOpClassification check(
|
public final MatrixOpClassification check(
|
||||||
int sourceAddress,
|
int sourceAddress,
|
||||||
|
|
Loading…
Reference in New Issue