Skip to content
Merged
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
10 changes: 5 additions & 5 deletions examples/driver/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ int main(int argc, char const *argv[])
* Free structures
*/

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ int main(int argc, char const *argv[])
free(message_buff);

// Destroy structures
TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);

/*
* Expected output:
Expand Down
14 changes: 6 additions & 8 deletions examples/exercise_contraction/exercise_contraction.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* 1. Fill in the arguments for creating the tensor (Line 47).
* 2. Complete the function call to create the execution plan. (Line 108)
* 3. Fill in the arguments for the execution of the product. (Line 178)
* 5. Fill in arguments to fetch the error message. (204)
* For a complete example usage. Look at examples/driver.c
* Compile with: make exercise_contraction
* The file to run is /examples/exercise_contraction/out/exercise_contraction(.exe for windows)
Expand Down Expand Up @@ -210,20 +209,19 @@ int main(int argc, char const *argv[])
// Print the output
print_tensor_s(nmode_D, extents_D, strides_D, D);


/*
* Free data
*/

// Free buffer
free(message_buff);

// TODO 5: Uncomment cleanup code once done
// TAPP_destory_tensor_product(plan);
// TAPP_destory_tensor_info(info_A);
// TAPP_destory_tensor_info(info_B);
// TAPP_destory_tensor_info(info_C);
// TAPP_destory_tensor_info(info_D);
// Destroy structures
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);

/*
* Expected output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ void* tucker_to_tensor_contraction(int nmode_A, int64_t* extents_A, int64_t* str
* Free structures
*/

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_D);

return D;
}
8 changes: 4 additions & 4 deletions examples/exercise_tucker/tapp_tucker/exercise_tucker.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ void* tucker_to_tensor_contraction(int nmode_A, int64_t* extents_A, int64_t* str
* Free structures
*/

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_D);

return D;
}
2 changes: 1 addition & 1 deletion src/tapp/product.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TAPP_error TAPP_create_tensor_product(TAPP_tensor_product* plan,
return 0;
}

TAPP_error TAPP_destory_tensor_product(TAPP_tensor_product plan)
TAPP_error TAPP_destroy_tensor_product(TAPP_tensor_product plan)
{
free(((struct plan*)plan)->idx_A);
free(((struct plan*)plan)->idx_B);
Expand Down
2 changes: 1 addition & 1 deletion src/tapp/product.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TAPP_EXPORT TAPP_error TAPP_create_tensor_product(TAPP_tensor_product* plan,
const int64_t* idx_D,
TAPP_prectype prec);

TAPP_EXPORT TAPP_error TAPP_destory_tensor_product(TAPP_tensor_product plan);
TAPP_EXPORT TAPP_error TAPP_destroy_tensor_product(TAPP_tensor_product plan);

//TODO: in-place operation: set C = NULL or TAPP_IN_PLACE?

Expand Down
2 changes: 1 addition & 1 deletion src/tapp/tensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TAPP_error TAPP_create_tensor_info(TAPP_tensor_info* info,
return 0;
}

TAPP_error TAPP_destory_tensor_info(TAPP_tensor_info info) {
TAPP_error TAPP_destroy_tensor_info(TAPP_tensor_info info) {
struct tensor_info* info_ptr = (struct tensor_info*)info;
free(info_ptr->extents);
free(info_ptr->strides);
Expand Down
2 changes: 1 addition & 1 deletion src/tapp/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TAPP_EXPORT TAPP_error TAPP_create_tensor_info(TAPP_tensor_info* info,
const int64_t* extents,
const int64_t* strides);

TAPP_EXPORT TAPP_error TAPP_destory_tensor_info(TAPP_tensor_info info);
TAPP_EXPORT TAPP_error TAPP_destroy_tensor_info(TAPP_tensor_info info);

TAPP_EXPORT int TAPP_get_nmodes(TAPP_tensor_info info);

Expand Down
114 changes: 57 additions & 57 deletions test/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ void contraction()

print_tensor_s(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void hadamard()
Expand Down Expand Up @@ -249,11 +249,11 @@ void hadamard()

print_tensor_s(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void complex_num()
Expand Down Expand Up @@ -327,11 +327,11 @@ void complex_num()

print_tensor_c(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void conjugate()
Expand Down Expand Up @@ -405,11 +405,11 @@ void conjugate()

print_tensor_c(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void zero_dim()
Expand Down Expand Up @@ -481,11 +481,11 @@ void zero_dim()

print_tensor_s(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void one_ext_contracted()
Expand Down Expand Up @@ -585,11 +585,11 @@ void one_ext_contracted()

print_tensor_s(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void one_ext_transfered()
Expand Down Expand Up @@ -689,11 +689,11 @@ void one_ext_transfered()

print_tensor_s(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void chained_diff_op()
Expand Down Expand Up @@ -818,13 +818,13 @@ void chained_diff_op()
printf("\tOperation 2:\n");
print_tensor_s(nmode_E, extents_E, strides_E, E);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_product(plan2);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destory_tensor_info(info_E);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_product(plan2);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
TAPP_destroy_tensor_info(info_E);
}

void chained_same_op()
Expand Down Expand Up @@ -928,11 +928,11 @@ void chained_same_op()
printf("\tOperation 2:\n");
print_tensor_s(nmode_D, extents_D, strides_D, E);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void negative_str()
Expand Down Expand Up @@ -1035,11 +1035,11 @@ void negative_str()

print_tensor_s(nmode_D, extents_D, strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}

void subtensors()
Expand Down Expand Up @@ -1182,9 +1182,9 @@ void subtensors()
int64_t super_strides_D[2] = {1, 4};
print_tensor_s(nmode_D, super_extents_D, super_strides_D, D);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
}
10 changes: 5 additions & 5 deletions test/exercise.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ int main(int argc, char const *argv[])
free(message_buff);

// Destroy structures
TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);

/*
* Expected output:
Expand Down
10 changes: 5 additions & 5 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ int main(int argc, char const *argv[])
printf(message_buff);
free(message_buff);

TAPP_destory_tensor_product(plan);
TAPP_destory_tensor_info(info_A);
TAPP_destory_tensor_info(info_B);
TAPP_destory_tensor_info(info_C);
TAPP_destory_tensor_info(info_D);
TAPP_destroy_tensor_product(plan);
TAPP_destroy_tensor_info(info_A);
TAPP_destroy_tensor_info(info_B);
TAPP_destroy_tensor_info(info_C);
TAPP_destroy_tensor_info(info_D);
return 0;
}
Loading
Loading