Skip to content

[SYCL][ESIMD][EMU] Clearing unused function arguments in PI module #6033

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

Merged
merged 4 commits into from
Apr 28, 2022

Conversation

dongkyunahn-intel
Copy link
Contributor

No description provided.

@dongkyunahn-intel dongkyunahn-intel requested a review from a team as a code owner April 20, 2022 21:51
@@ -66,7 +66,7 @@ pi_result getInfoImpl(size_t ParamValueSize, void *ParamValue,
template <typename T>
pi_result getInfo(size_t ParamValueSize, void *ParamValue,
size_t *ParamValueSizeRet, T Value) {
auto assignment = [](void *ParamValue, T Value, size_t ValueSize) {
auto assignment = [](void *ParamValue, T Value, size_t) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember any agreement on this. So, this may be Ok.
In those cases where the type does not describe the parameter it is ok to omit the name, on other like 'size_t' it may be still good to have a name in comment section. For example:

Suggested change
auto assignment = [](void *ParamValue, T Value, size_t) {
auto assignment = [](void *ParamValue, T Value, size_t /*ValueSize*/) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In other plug-in implementations, (void)XXX; is used. I introduced ARG_UNUSED macro for suppressing warning messages from unused arguments.

Comment on lines 1377 to 1378
pi_result piEventGetProfilingInfo(pi_event, pi_profiling_info, size_t, void *,
size_t *) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Because the function is not documented it may be good to have something like:

Suggested change
pi_result piEventGetProfilingInfo(pi_event, pi_profiling_info, size_t, void *,
size_t *) {
pi_result piEventGetProfilingInfo(pi_event, pi_profiling_info, size_t /*ParamValueSize*/, void */*ParamValue*/,
size_t */*ParamValueSizeRet*/) {

@v-klochkov
Copy link
Contributor

This is clear/good fix.
In my opinion, it is though better to retain some additional information about the parameters, either in a comment section before the functions, or in comment section when the argument is not described by its type.

Replacing 'pi_device Device' with 'pi_device' is Ok, while replacing 'size_t *ParamVlaueSizeRet' with 'size_t *' seems like luck of information in the new code.
I noticed only the first couple of such cases explicitly as examples.

@kbobrovs
Copy link
Contributor

@steffenlarsen, please review

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

LGTM!

@dongkyunahn-intel
Copy link
Contributor Author

Unrelated failure from 'OCL Gen9 LLVM Test Suite'

Failed Tests (1):
  SYCL :: KernelAndProgram/undefined-symbol.cpp

@kbobrovs kbobrovs merged commit 150f10d into intel:sycl Apr 28, 2022
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.

4 participants