This is an archive of the discontinued LLVM Phabricator instance.

[StreamExecutor] Dev handles in platform interface
ClosedPublic

Authored by jhen on Aug 31 2016, 5:38 PM.

Details

Summary

This is the first in a series of patches that will convert
GlobalDeviceMemory to own its device memory handle. The first step is to
remove GlobalDeviceMemoryBase from the PlatformInterface interfaces and
use raw handles there instead. This is useful because
GlobalDeviceMemoryBase is going to lose its importance in this process.

Diff Detail

Event Timeline

jhen updated this revision to Diff 69933.Aug 31 2016, 5:38 PM
jhen retitled this revision from to [StreamExecutor] Dev handles in platform interface.
jhen updated this object.
jhen added a reviewer: jlebar.
jhen added subscribers: parallel_libs-commits, jprice.
jlebar accepted this revision.Sep 1 2016, 11:05 AM
jlebar edited edge metadata.

I like factoring out this test platform.

streamexecutor/include/streamexecutor/PlatformInterfaces.h
108

Do we want the dst handles to be non-const void*s? Or is the idea that the handle is always a const thing because you never write to it from host code?

134

Same for the handle we're freeing here. (Although, as was pointed out to me recently, it's perfectly OK to call delete on a C++ const pointer.)

This revision is now accepted and ready to land.Sep 1 2016, 11:05 AM
jhen added inline comments.Sep 1 2016, 11:52 AM
streamexecutor/include/streamexecutor/PlatformInterfaces.h
108

Yeah, I wanted it to be const because I think that's more appropriate for an opaque handle. I'll keep it that way unless others want it changed.

134

My idea is that the platform-specific implementation Will probably have to cast this handle to something else before using it anyway, so throwing on a const_cast too, if necessary, should seem natural.

This revision was automatically updated to reflect the committed changes.