Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Add test for extended deleters #11344

Merged
merged 16 commits into from
Oct 20, 2023
Merged

Conversation

hdelan
Copy link
Contributor

@hdelan hdelan commented Sep 28, 2023

A typo in #10514 got rid of the extended deleter callbacks. This reinstates them.

@hdelan hdelan requested a review from a team as a code owner September 28, 2023 14:12
@hdelan hdelan temporarily deployed to WindowsCILock September 28, 2023 14:12 — with GitHub Actions Inactive
Copy link
Contributor

@npmiller npmiller left a comment

Choose a reason for hiding this comment

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

LGTM

@hdelan hdelan temporarily deployed to WindowsCILock September 28, 2023 16:04 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock September 28, 2023 16:27 — with GitHub Actions Inactive
@aelovikov-intel
Copy link
Contributor

Why don't we need a test for/with this?

@hdelan hdelan requested a review from a team as a code owner September 29, 2023 09:23
@hdelan
Copy link
Contributor Author

hdelan commented Sep 29, 2023

Why don't we need a test for/with this?

I think we do need a test. I have added a simple test.

@hdelan hdelan temporarily deployed to WindowsCILock September 29, 2023 09:46 — with GitHub Actions Inactive
Co-authored-by: aelovikov-intel <andrei.elovikov@intel.com>
@hdelan hdelan temporarily deployed to WindowsCILock September 29, 2023 16:55 — with GitHub Actions Inactive
@againull
Copy link
Contributor

againull commented Oct 9, 2023

Added test extended_deleters/extended_deleters.cpp is failing in CI for some reasons. Could you please address?

# RUN: at line 1
%{build} -o D:\github\_work\llvm\llvm\build\tools\sycl\test\extended_deleters\Output\extended_deleters.cpp.tmp.out
# executed command: '%{build}' -o 'D:\github\_work\llvm\llvm\build\tools\sycl\test\extended_deleters\Output\extended_deleters.cpp.tmp.out'
# .---command stderr------------
# | '%{build}': command not found
# `-----------------------------
# error: command failed with exit status: 127

@hdelan hdelan changed the title [SYCL][HIP] Re add extended deleters [SYCL] Add test for extended deleters Oct 10, 2023
@hdelan hdelan temporarily deployed to WindowsCILock October 13, 2023 14:43 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 13, 2023 15:03 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 17, 2023 13:26 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 17, 2023 13:47 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 19, 2023 11:43 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 19, 2023 12:02 — with GitHub Actions Inactive
This reverts commit 9aa3a27.
@hdelan hdelan temporarily deployed to WindowsCILock October 19, 2023 12:58 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 19, 2023 13:18 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 20, 2023 10:30 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 20, 2023 10:48 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 20, 2023 11:11 — with GitHub Actions Inactive
Co-authored-by: Kenneth Benzie (Benie) <k.benzie83@gmail.com>
@hdelan hdelan temporarily deployed to WindowsCILock October 20, 2023 11:20 — with GitHub Actions Inactive
@hdelan hdelan temporarily deployed to WindowsCILock October 20, 2023 11:42 — with GitHub Actions Inactive
@kbenzie
Copy link
Contributor

kbenzie commented Oct 20, 2023

@intel/dpcpp-l0-pi-reviewers @intel/llvm-reviewers-runtime please review ASAP, this is the start of a PR dependency chain.

@hdelan
Copy link
Contributor Author

hdelan commented Oct 20, 2023

Ping @intel/llvm-gatekeepers

Comment on lines +1 to +18
// REQUIRES: hip, cuda

// RUN: %{build} -o %t.out
// RUN: %{run} %t.out | FileCheck %s

// CHECK: This extended deleter should be called at ctx destruction.

#include <sycl/sycl.hpp>

int main() {
sycl::context c;
sycl::detail::pi::contextSetExtendedDeleter(
c,
[](void *) {
printf("This extended deleter should be called at ctx destruction.");
},
nullptr);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need it here and not in the UR repo? This makes no sense to me... sycl::detail::pi has to be eradicated from the sycl repo, IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the test does move to UR it'll need to be in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have a test for this in the UR repo but this is something that is used in oneMKL through the sycl::detail::pi interface. I think it's worthwhile having a test to make sure that the SYCL interface is working as well as the UR one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@aelovikov-intel aelovikov-intel Oct 20, 2023

Choose a reason for hiding this comment

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

something that is used in oneMKL through the sycl::detail::pi interface.

That is bad... detail shouldn't be used in production.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There have been some changes in UR contexts of late, and when these are settled we are going to re-review this entry point and see if we can potentially remove it from oneMKL, but as it stands it is necessary

Copy link
Contributor

Choose a reason for hiding this comment

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

I've submitted oneapi-src/oneMKL#401. Personally, I'm in favor of removing the test: we do not guarantee availability of the tested functionality. The fact that it resides in sycl::detail namespace explicitly communicates that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should remove this test whenever we stop using this in oneMKL. The reason why I am adding this test is because this functionality was accidentally removed, and since there was no testing for it we didn't realise that something was broken, and oneMKL ended up breaking.

Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

I'm not excited about this change, but I also don't want to have this discussion here.

@againull againull merged commit 2def4d8 into intel:sycl Oct 20, 2023
11 checks passed
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.

8 participants