Skip to content

[SYCL][CUDA] Replace assert with CHECK #1302

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

Conversation

bjoernknafla
Copy link
Contributor

Fix LIT tests that are not compiled with assertions enabled but call
assert.

Only done for LIT tests that requires fixes during work on CUDA.

Signed-off-by: Bjoern Knafla bjoern@codeplay.com

Fix LIT tests that are not compiled with assertions enabled but call
assert.

Signed-off-by: Bjoern Knafla <bjoern@codeplay.com>
@AlexeySachkov
Copy link
Contributor

Only done for LIT tests that requires fixes during work on CUDA.

Anyway, that's a really good thing to do. Thanks!

@@ -16,7 +16,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "../../helpers.hpp"
#include <CL/sycl.hpp>
#include <cassert>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include <cassert>

Do we still need this include?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn’t be necessary - I will fix this on Monday.

@@ -13,9 +13,9 @@
#include <detail/kernel_impl.hpp>
#include <detail/scheduler/scheduler.hpp>

#include "../helpers.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

What about replacing assert in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is probably (cannot check at the moment) an artifact of breaking a far too large for its own good PR into smaller PRs. I will check if that is the case and repair it.

@@ -42,9 +43,10 @@ int getExpectedQueueNumber(cl_device_id device_id, int default_value) {
sizeof(reportedProps),
&reportedProps,
NULL);
assert(CL_SUCCESS == iRet && "Failed to obtain queue info from ocl device");
CHECK(CL_SUCCESS == iRet && "Failed to obtain queue info from ocl device");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why only part of the asserts are replaced in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching this. Breaking a larger PR down into smaller ones I might have lost some changes (or I was sloppy in the first place). I will look into it.

@bader bader added the cuda CUDA back-end label Mar 12, 2020
fwyzard added a commit to fwyzard/llvm that referenced this pull request Mar 14, 2020
@@ -11,6 +11,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "../helpers.hpp"
Copy link
Contributor

@romanovvlad romanovvlad Mar 17, 2020

Choose a reason for hiding this comment

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

Consider adding directory with "helpers.hpp" to the list of include directories(aka -I).

Copy link
Contributor

Choose a reason for hiding this comment

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

@bjoernknafla Will you do it or we merging as is?

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 am currently experiencing many LIT failures on the sycl branch and am investigating before I can rebase.

As @bader pointed out in another PR, also there is no need to replace assert as it isn't turned off when not explicitly defining the NDEBUG preprocessor symbol. I was confused as CMake has extra behavior but these LIT tests do not go through CMake. I am considering rejecting and closing this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

Copy link
Contributor

@romanovvlad romanovvlad left a comment

Choose a reason for hiding this comment

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

LGTM

fwyzard added a commit to cms-patatrack/llvm that referenced this pull request Mar 21, 2020
@bjoernknafla
Copy link
Contributor Author

As @bader pointed out here: #1304 (comment) - it is compeltely fine to use assert as no explicit NDEBUG is set by the LIT tests. Therefore I will close this PR.

vmaksimo pushed a commit to vmaksimo/llvm that referenced this pull request Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda CUDA back-end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants