Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions src/index_notation/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ void unpackResults(size_t numResults, const vector<void*> arguments,
} else if (modeType.getName() == Sparse.getName()) {
auto size = ((int*)tensorData->indices[i][0])[num];
Array pos = Array(type<int>(), tensorData->indices[i][0],
num+1, Array::UserOwns);
num+1, Array::Free);
Array idx = Array(type<int>(), tensorData->indices[i][1],
size, Array::UserOwns);
size, Array::Free);
modeIndices.push_back(ModeIndex({pos, idx}));
num = size;
} else {
taco_not_supported_yet;
}
}
storage.setIndex(Index(format, modeIndices));
storage.setValues(Array(storage.getComponentType(), tensorData->vals, num));
storage.setValues(Array(storage.getComponentType(), tensorData->vals, num, Array::Free));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lower/lowerer_impl_imperative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,7 @@ std::vector<ir::Stmt> LowererImplImperative::constructInnerLoopCasePreamble(ir::
for(size_t i = 0; i < coordComparisons.size(); ++i) {
Expr nonZeroCase;
if(coordComparisons[i].defined() && valueComparisons[i].defined()) {
nonZeroCase = taco::ir::conjunction({coordComparisons[i], valueComparisons[i]});
nonZeroCase = conjunction({coordComparisons[i], valueComparisons[i]});
} else if (valueComparisons[i].defined()) {
nonZeroCase = valueComparisons[i];
} else if (coordComparisons[i].defined()) {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/file_io_mtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TensorBase dispatchReadMTX(std::istream& stream, const T& format, bool pack) {
<< "Unknown type of MatrixMarket";
// formats = [coordinate array]
// field = [real integer complex pattern]
taco_uassert(field=="real") << "MatrixMarket field not available";
taco_uassert(field=="real" || field=="integer") << "MatrixMarket field not available";
// symmetry = [general symmetric skew-symmetric Hermitian]
taco_uassert((symmetry=="general") || (symmetry=="symmetric"))
<< "MatrixMarket symmetry not available";
Expand Down
15 changes: 5 additions & 10 deletions src/taco_tensor_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ taco_tensor_t* init_taco_tensor_t(int32_t order, int32_t csize,
t->indices = (uint8_t ***) alloc_mem(order * sizeof(uint8_t***));
t->csize = csize;

int fill_bytes = csize / 8;
t->fill_value = (uint8_t*) alloc_mem(fill_bytes);

if (fill_ptr) {
uint8_t* fill_inp = (uint8_t*) fill_ptr;
for (int i = 0; i < fill_bytes; ++i) {
t->fill_value[i] = fill_inp[i];
}
}
t->fill_value = (uint8_t*) fill_ptr;

for (int32_t i = 0; i < order; i++) {
t->dimensions[i] = dimensions[i];
Expand All @@ -61,6 +53,9 @@ taco_tensor_t* init_taco_tensor_t(int32_t order, int32_t csize,
case taco_mode_sparse:
t->indices[i] = (uint8_t **) alloc_mem(2 * sizeof(uint8_t **));
break;
case taco_mode_dia1:
t->indices[i] = (uint8_t **) alloc_mem(3 * sizeof(uint8_t **));
break;
}
}
return t;
Expand All @@ -76,4 +71,4 @@ void deinit_taco_tensor_t(taco_tensor_t* t) {
free_mem(t->mode_ordering);
free_mem(t->mode_types);
free_mem(t);
}
}
8 changes: 4 additions & 4 deletions src/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,19 @@ static size_t unpackTensorData(const taco_tensor_t& tensorData,
numVals *= ((int*)tensorData.indices[i][0])[0];
} else if (modeType.getName() == Sparse.getName()) {
auto size = ((int*)tensorData.indices[i][0])[numVals];
Array pos = Array(type<int>(), tensorData.indices[i][0], numVals+1, Array::UserOwns);
Array idx = Array(type<int>(), tensorData.indices[i][1], size, Array::UserOwns);
Array pos = Array(type<int>(), tensorData.indices[i][0], numVals+1, Array::Free);
Array idx = Array(type<int>(), tensorData.indices[i][1], size, Array::Free);
modeIndices.push_back(ModeIndex({pos, idx}));
numVals = size;
} else if (modeType.getName() == Singleton.getName()) {
Array idx = Array(type<int>(), tensorData.indices[i][1], numVals, Array::UserOwns);
Array idx = Array(type<int>(), tensorData.indices[i][1], numVals, Array::Free);
modeIndices.push_back(ModeIndex({makeArray(type<int>(), 0), idx}));
} else {
taco_not_supported_yet;
}
}
storage.setIndex(Index(format, modeIndices));
storage.setValues(Array(tensor.getComponentType(), tensorData.vals, numVals));
storage.setValues(Array(tensor.getComponentType(), tensorData.vals, numVals, Array::Free));
return numVals;
}

Expand Down