Skip to content

Commit 89d5df6

Browse files
authored
Also call mkl_sycl_destructor before deleting SYCL queue (#420)
1 parent 5cce2db commit 89d5df6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

deps/src/onemkl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4320,9 +4320,10 @@ extern "C" int onemklXsparse_matmat(syclQueue_t device_queue, matrix_handle_t A,
43204320

43214321
// oneMKL keeps a cache of SYCL queues and tries to destroy them when unloading the library.
43224322
// that is incompatible with oneAPI.jl destroying queues before that, so call mkl_free_buffers
4323-
// to manually wipe the device cache when we're destroying queues.
4323+
// and mkl_sycl_destructor to manually cleanup oneMKL cache when we're destroying queues.
43244324

43254325
extern "C" int onemklDestroy() {
43264326
mkl_free_buffers();
4327+
mkl_sycl_destructor();
43274328
return 0;
43284329
}

deps/src/onemkl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,6 +2572,7 @@ int onemklXsparse_matmat(syclQueue_t device_queue, matrix_handle_t A, matrix_han
25722572
matrix_handle_t C, onemklMatmatRequest req, matmat_descr_t
25732573
descr, int64_t *sizeTempBuffer, void *tempBuffer);
25742574

2575+
void mkl_sycl_destructor(void);
25752576
int onemklDestroy(void);
25762577
#ifdef __cplusplus
25772578
}

0 commit comments

Comments
 (0)