[Parallel_libs-commits] [PATCH] D24473: [SE] Host platform implementation
Justin Lebar via Parallel_libs-commits
parallel_libs-commits at lists.llvm.org
Tue Sep 13 09:22:18 PDT 2016
jlebar added inline comments.
================
Comment at: streamexecutor/include/streamexecutor/KernelSpec.h:273
@@ +272,3 @@
+ HostFunctionTy Function) {
+ HostFunction = llvm::make_unique<HostFunctionTy>(Function);
+ return *this;
----------------
Nit, `std::move(Function)`. (std::function objects may be heavyweight in general, even though in this case it probably doesn't matter.)
================
Comment at: streamexecutor/include/streamexecutor/platforms/host/HostPlatform.h:39
@@ +38,3 @@
+ TheDevice = llvm::make_unique<Device>(new HostPlatformDevice());
+ return TheDevice.get();
+ }
----------------
Do we need this to be thread-safe?
================
Comment at: streamexecutor/include/streamexecutor/platforms/host/HostPlatform.h:39
@@ +38,3 @@
+ TheDevice = llvm::make_unique<Device>(new HostPlatformDevice());
+ return TheDevice.get();
+ }
----------------
jlebar wrote:
> Do we need this to be thread-safe?
I'm confused where we call delete on the HostPlatformDevice. It's not super important, but I think if we don't it may show up as a leak in asan, and that means it will show up as a leak in user programs.
https://reviews.llvm.org/D24473
More information about the Parallel_libs-commits
mailing list