added correct use of shmem_free
This commit is contained in:
parent
46bcbf3805
commit
3f2769bf26
1 changed files with 4 additions and 1 deletions
|
@ -32,7 +32,8 @@ void ggml_openshmem_backend_free(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ggml_openshmem_context * ggml_openshmem_init(void) {
|
struct ggml_openshmem_context * ggml_openshmem_init(void) {
|
||||||
struct ggml_openshmem_context * ctx = calloc(1, sizeof(struct ggml_openshmem_context));
|
struct ggml_openshmem_context * ctx =
|
||||||
|
(struct ggml_openshmem_context *)calloc(1, sizeof(struct ggml_openshmem_context));
|
||||||
|
|
||||||
ctx->pe = shmem_my_pe();
|
ctx->pe = shmem_my_pe();
|
||||||
ctx->n_pes = shmem_n_pes();
|
ctx->n_pes = shmem_n_pes();
|
||||||
|
@ -62,6 +63,8 @@ struct ggml_openshmem_context * ggml_openshmem_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ggml_openshmem_free(struct ggml_openshmem_context * ctx) {
|
void ggml_openshmem_free(struct ggml_openshmem_context * ctx) {
|
||||||
|
shmem_free(ctx->symmetric_comm_structure);
|
||||||
|
shmem_free(ctx->recv_signal);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue