Skip to content

[SYCL][NFC] Code cleanup revealed by self-build. #3230

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 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4797,6 +4797,8 @@ enqueueMemImageCommandHelper(pi_command_type CommandType, pi_queue Queue,

// TODO: Level Zero does not support row_pitch/slice_pitch for images yet.
// Check that SYCL RT did not want pitch larger than default.
(void)RowPitch;
(void)SlicePitch;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you do not use these variables, why not... removing them? :-)

Such as having in the function definition just:

                             size_t /* RowPitch */, size_t /* SlicePitch */,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are used below inside the ASSERT, inside the DEBUG flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. So probably your change is adequate.
I guess it will be ugly to add the name in the function definition according to the value of NDEBUG... :-)

#ifndef NDEBUG
PI_ASSERT(SrcMem->isImage(), PI_INVALID_MEM_OBJECT);

Expand Down
2 changes: 2 additions & 0 deletions sycl/source/detail/memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void *MemoryManager::allocateInteropMemObject(
ContextImplPtr TargetContext, void *UserPtr,
const EventImplPtr &InteropEvent, const ContextImplPtr &InteropContext,
const sycl::property_list &, RT::PiEvent &OutEventToWait) {
(void)TargetContext;
(void)InteropContext;
Copy link
Contributor

Choose a reason for hiding this comment

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

Idem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were right about UserPtr. Thanks.

// If memory object is created with interop c'tor return cl_mem as is.
assert(TargetContext == InteropContext && "Expected matching contexts");
OutEventToWait = InteropEvent->getHandleRef();
Expand Down