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] Implicit conversion from id<1> to size_t #939

Merged
merged 1 commit into from
Jan 22, 2020
Merged

[SYCL] Implicit conversion from id<1> to size_t #939

merged 1 commit into from
Jan 22, 2020

Conversation

idubinov
Copy link
Contributor

Implements id<1> -> size_t implicit conversion.

Signed-off-by: Igor Dubinov igor.dubinov@intel.com

@romanovvlad
Copy link
Contributor

@AlexeySachkov ping

@bader bader changed the title [SYCL] implicit conversion from id<1> to size_t [SYCL] Implicit conversion from id<1> to size_t Jan 10, 2020
Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

I don't see new functionality added by this patch in the spec.
We should inform developers that they use non-standard functionality (e.g. provide an option to disable non-portable extensions, add a compiler note/warning, etc.)

tagging @mkinsner, @jbrodman, @rolandschulz

sycl/include/CL/sycl/id.hpp Outdated Show resolved Hide resolved
sycl/include/CL/sycl/id.hpp Outdated Show resolved Hide resolved
@rolandschulz
Copy link
Contributor

We should inform developers that they use non-standard functionality (e.g. provide an option to disable non-portable extensions, add a compiler note/warning, etc.)

Yes. It should only be enabled if all the verbosity/usability extensions are enabled. What's the status of adding a compiler switch to enable/disables extensions (#806)?

@intel intel deleted a comment from rolandschulz Jan 11, 2020
@bader
Copy link
Contributor

bader commented Jan 13, 2020

We should inform developers that they use non-standard functionality (e.g. provide an option to disable non-portable extensions, add a compiler note/warning, etc.)

Yes. It should only be enabled if all the verbosity/usability extensions are enabled. What's the status of adding a compiler switch to enable/disables extensions (#806)?

#806 is about controlling language extensions, where this patch extends library API, which is supposed be configured via preprocessor definitions.

Copy link
Contributor

@AlexeySachkov AlexeySachkov left a comment

Choose a reason for hiding this comment

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

Overall, I don't have objections against this patch, but let's guard non-standard things under #ifndef, so users can disable them (don't forget to add test for this new macro)

return result;
}

operator size_t() const { return this->get(0); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please guard this new non-standard method with some preprocessor macro? Similar to how it is done in #974

It would be also good to have another one macro which allows to disable all non-standard features introduced by header files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added "SYCL_DISABLE_ID_TO_INT_CONV"

@rolandschulz
Copy link
Contributor

#806 is about controlling language extensions, where this patch extends library API, which is supposed be configured via preprocessor definitions.

I still believe that the user doesn't care whether a language extension is implemented in the FE or in the library and would like to be able to use the same mechanism for both. Note that for C++ this works the same. If I use std=c++17 this enables both the FE and library features. I don't have to manually set preprocessor defines to enable or disable library features. And this regardless of the fact that internally it is just setting a preprocessor flag for the library features based on the compiler flag.

@bader
Copy link
Contributor

bader commented Jan 14, 2020

#806 is about controlling language extensions, where this patch extends library API, which is supposed be configured via preprocessor definitions.

I still believe that the user doesn't care whether a language extension is implemented in the FE or in the library and would like to be able to use the same mechanism for both. Note that for C++ this works the same. If I use std=c++17 this enables both the FE and library features. I don't have to manually set preprocessor defines to enable or disable library features. And this regardless of the fact that internally it is just setting a preprocessor flag for the library features based on the compiler flag.

Right. But #806 should not block library development.
I see that developers adding library extensions add pre-processor macro and let the compiler know about new switch.
The compiler simplifies user interface by defining pre-processor macro based on compiler flags, but this change can be done separately. Are you okay with that?

@rolandschulz
Copy link
Contributor

The compiler simplifies user interface by defining pre-processor macro based on compiler flags, but this change can be done separately. Are you okay with that?

Yes. I agree.

AlexeySachkov
AlexeySachkov previously approved these changes Jan 21, 2020
sycl/include/CL/sycl/id.hpp Outdated Show resolved Hide resolved
sycl/include/CL/sycl/id.hpp Outdated Show resolved Hide resolved
sycl/test/basic_tests/id.cpp Outdated Show resolved Hide resolved
sycl/test/basic_tests/id.cpp Outdated Show resolved Hide resolved
Signed-off-by: Igor Dubinov <igor.dubinov@intel.com>
@bader bader merged commit 5416f32 into intel:sycl Jan 22, 2020
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.

6 participants