Skip to content

[CUSOLVER] workaround for issue #216#217

Closed
ericlars wants to merge 1 commit intouxlfoundation:developfrom
ericlars:cusolver_synchronous_wo
Closed

[CUSOLVER] workaround for issue #216#217
ericlars wants to merge 1 commit intouxlfoundation:developfrom
ericlars:cusolver_synchronous_wo

Conversation

@ericlars
Copy link
Contributor

RE: #215

template <typename H, typename F>
static inline void onemkl_cusolver_host_task(H &cgh, sycl::queue queue, F f) {
(void)host_task_internal(cgh, queue, f);
queue.wait(); //temporary workaround for issue #216
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this does not work because it is actually syncing the queue before the command group associated with this onemkl_cusolver_host_task is submitted: The result is that I find this does not solve #216

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly I find that replacing queue.wait() with a change to host_task_internal:

static inline void host_task_internal(H &cgh, sycl::queue queue, F f) {
    cgh.interop_task([f, queue](sycl::interop_handler ih) {
        auto sc = CusolverScopedContextHandler(queue, ih);
        f(sc);
        auto handle = sc.get_handle(queue);
        cusolverStatus_t err;
        cudaStream_t currentStreamId;
        CUSOLVER_ERROR_FUNC(cusolverDnGetStream, err, handle, &currentStreamId);
        cuStreamSynchronize(currentStreamId);
    });
}

is also not solving #216. It seems that you have to either call cuStreamSynchronize from within the user facing onemkl_cusolver_host_task or call queue.wait() after the command group is submitted.

@ericlars ericlars closed this Sep 2, 2022
@ericlars ericlars deleted the cusolver_synchronous_wo branch September 2, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments