@Override public final void onCompletion(CountedCompleter<?> caller) { if (!isLeaf()) { Node<P_OUT> result; thisNodeSize = leftChild.thisNodeSize + rightChild.thisNodeSize; if (canceled) { thisNodeSize = 0; result = getEmptyResult(); } else if (thisNodeSize == 0) result = getEmptyResult(); else if (leftChild.thisNodeSize == 0) result = rightChild.getLocalResult(); else { result = Nodes.conc(op.getOutputShape(), leftChild.getLocalResult(), rightChild.getLocalResult()); } setLocalResult(isRoot() ? doTruncate(result) : result); completed = true; } if (targetSize >= 0 && !isRoot() && isLeftCompleted(targetOffset + targetSize)) cancelLaterNodes(); super.onCompletion(caller); }
@Override public final void onCompletion(CountedCompleter<?> caller) { if (!isLeaf()) { Node<P_OUT> result; thisNodeSize = leftChild.thisNodeSize + rightChild.thisNodeSize; if (canceled) { thisNodeSize = 0; result = getEmptyResult(); } else if (thisNodeSize == 0) result = getEmptyResult(); else if (leftChild.thisNodeSize == 0) result = rightChild.getLocalResult(); else { result = Nodes.conc(op.getOutputShape(), leftChild.getLocalResult(), rightChild.getLocalResult()); } setLocalResult(isRoot() ? doTruncate(result) : result); completed = true; } if (targetSize >= 0 && !isRoot() && isLeftCompleted(targetOffset + targetSize)) cancelLaterNodes(); super.onCompletion(caller); }
@Override protected void cancel() { super.cancel(); if (completed) setLocalResult(getEmptyResult()); }
@Override protected void cancel() { super.cancel(); if (completed) setLocalResult(getEmptyResult()); }