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

[tests][modernize]Make the tests compile with hipSYCL #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sbalint98
Copy link

This PR concenrs the tests. The following two changes were made:

  • use cl::sycl::async_handler instead of auto type
  • use .what() instead of using get_cl_code()

*Changed e.get_cl_code to e.what
*Fixed namespace sycl:: to cl::sycl
*Gave explict type to exception_handler
Copy link

@fodinabor fodinabor left a comment

Choose a reason for hiding this comment

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

looks good in general :)

@@ -224,7 +224,7 @@ template <typename fp>
static void gemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE transa, CBLAS_TRANSPOSE transb, const int *m,
const int *n, const int *k, const fp *alpha, const fp *a, const int *lda,
const fp *b, const int *ldb, const fp *beta, fp *c, const int *ldc);

#ifdef NOT_HIPSYCL

Choose a reason for hiding this comment

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

could you use the ENABLE_HALF_ROUTINES here and get rid of the explicit NOT_HIPSYCL macro?
or instead just use a macro that is defined by hipSYCL anyways?

Copy link
Author

@sbalint98 sbalint98 May 21, 2021

Choose a reason for hiding this comment

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

Ohh.. this shouldn't be here at all... this should be in #6 ... Thanks for noticing :) But I think I'll let this be here, instead of moving it over to the other PR

@@ -44,6 +44,7 @@

#define POISSON_ARGS 0.5

using namespace cl;
Copy link

Choose a reason for hiding this comment

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

Why do you need to open the cl namespace if you then qualify everything with cl:: in the code below?

Copy link
Author

Choose a reason for hiding this comment

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

I don't see any good reason to do it so. I will remove the qualifications from below, to reduce the diff.

@@ -46,15 +46,15 @@ namespace {
template <typename fp>
int test(device *dev, oneapi::mkl::layout layout, int64_t group_count) {
// Catch asynchronous exceptions.
auto exception_handler = [](exception_list exceptions) {
cl::sycl::async_handler exception_handler = [](exception_list exceptions) {
Copy link

Choose a reason for hiding this comment

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

Why is it even necessary to not use auto? I think it should also work with auto.

Copy link
Author

Choose a reason for hiding this comment

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

Mhmm, it doesn't seem to be necessary anymore... I recall that a few weeks ago there was an issue with hipSYCL regarding this.

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.

3 participants