This is an archive of the discontinued LLVM Phabricator instance.

[StreamExecutor] Pass device memory by ref
ClosedPublic

Authored by jhen on Sep 1 2016, 4:43 PM.

Details

Summary

Step 3 of getting GlobalDeviceMemory to own its handle.

Since GlobalDeviceMemory will no longer by copy-constructible, we must
pass instances by reference rather than by value.

Diff Detail

Repository
rL LLVM

Event Timeline

jhen updated this revision to Diff 70101.Sep 1 2016, 4:43 PM
jhen retitled this revision from to [StreamExecutor] Pass device memory by ref.
jhen updated this object.
jhen added a reviewer: jlebar.
jhen added subscribers: parallel_libs-commits, jprice.
jhen updated this revision to Diff 70109.Sep 1 2016, 5:13 PM
  • clang-format
jlebar added inline comments.Sep 1 2016, 5:16 PM
streamexecutor/include/streamexecutor/Device.h
223 ↗(On Diff #70109)

I wonder if we should take by non-const reference. This "pass mutable things by pointer" idiom is kind of a Google-ism; I am not sure it will make a lot of sense to other people reading the code.

jhen updated this revision to Diff 70112.Sep 1 2016, 5:28 PM
  • Use ref instead of pointer for dst
jlebar accepted this revision.Sep 1 2016, 5:29 PM
jlebar edited edge metadata.
This revision is now accepted and ready to land.Sep 1 2016, 5:29 PM
jhen added inline comments.Sep 1 2016, 5:29 PM
streamexecutor/include/streamexecutor/Device.h
223 ↗(On Diff #70112)

Yeah, you're right. It could be confusing. I've changed all the destinations to pass-by-non-const-ref now instead of pass-by-pointer.

This revision was automatically updated to reflect the committed changes.