From 8a1bfc761b20ee304aeecaf550f48368f425d69c Mon Sep 17 00:00:00 2001 From: waredjeb <39335169+waredjeb@users.noreply.github.com> Date: Thu, 31 Oct 2019 11:54:07 +0100 Subject: [PATCH] Replace use of CUDA API wrapper unique_ptrs with CUDAUtilities unique_ptrs (#396) Replace cuda::memory::device::make_unique() calls with cudautils::make_device_unique() Replace cuda::memory::host::make_unique() with cudautils::make_host_unique() --- .../SiPixelClusterizer/test/gpuClustering_t.h | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/RecoLocalTracker/SiPixelClusterizer/test/gpuClustering_t.h b/RecoLocalTracker/SiPixelClusterizer/test/gpuClustering_t.h index bb86c1392cdf9..03a45baa3ba24 100644 --- a/RecoLocalTracker/SiPixelClusterizer/test/gpuClustering_t.h +++ b/RecoLocalTracker/SiPixelClusterizer/test/gpuClustering_t.h @@ -12,6 +12,7 @@ #ifdef __CUDACC__ #include +#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" #include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h" #include "HeterogeneousCore/CUDAUtilities/interface/launch.h" @@ -44,17 +45,14 @@ int main(void) { #ifdef __CUDACC__ auto current_device = cuda::device::current::get(); - auto d_id = cuda::memory::device::make_unique(current_device, numElements); - auto d_x = cuda::memory::device::make_unique(current_device, numElements); - auto d_y = cuda::memory::device::make_unique(current_device, numElements); - auto d_adc = cuda::memory::device::make_unique(current_device, numElements); - - auto d_clus = cuda::memory::device::make_unique(current_device, numElements); - - auto d_moduleStart = cuda::memory::device::make_unique(current_device, MaxNumModules + 1); - - auto d_clusInModule = cuda::memory::device::make_unique(current_device, MaxNumModules); - auto d_moduleId = cuda::memory::device::make_unique(current_device, MaxNumModules); + auto d_id = cudautils::make_device_unique(numElements, nullptr); + auto d_x = cudautils::make_device_unique(numElements, nullptr); + auto d_y = cudautils::make_device_unique(numElements, nullptr); + auto d_adc = cudautils::make_device_unique(numElements, nullptr); + auto d_clus = cudautils::make_device_unique(numElements, nullptr); + auto d_moduleStart = cudautils::make_device_unique(MaxNumModules + 1, nullptr); + auto d_clusInModule = cudautils::make_device_unique(MaxNumModules, nullptr); + auto d_moduleId = cudautils::make_device_unique(MaxNumModules, nullptr); #else auto h_moduleStart = std::make_unique(MaxNumModules + 1);