Skip to content

Commit

Permalink
Replace use of CUDA API wrapper unique_ptrs with CUDAUtilities unique…
Browse files Browse the repository at this point in the history
…_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()
  • Loading branch information
waredjeb authored and fwyzard committed Oct 19, 2020
1 parent a035c70 commit f0ce448
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions RecoLocalTracker/SiPixelClusterizer/test/gpuClustering_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#ifdef __CUDACC__
#include <cuda/api_wrappers.h>

#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"
Expand Down Expand Up @@ -44,17 +45,14 @@ int main(void) {

#ifdef __CUDACC__
auto current_device = cuda::device::current::get();
auto d_id = cuda::memory::device::make_unique<uint16_t[]>(current_device, numElements);
auto d_x = cuda::memory::device::make_unique<uint16_t[]>(current_device, numElements);
auto d_y = cuda::memory::device::make_unique<uint16_t[]>(current_device, numElements);
auto d_adc = cuda::memory::device::make_unique<uint16_t[]>(current_device, numElements);

auto d_clus = cuda::memory::device::make_unique<int[]>(current_device, numElements);

auto d_moduleStart = cuda::memory::device::make_unique<uint32_t[]>(current_device, MaxNumModules + 1);

auto d_clusInModule = cuda::memory::device::make_unique<uint32_t[]>(current_device, MaxNumModules);
auto d_moduleId = cuda::memory::device::make_unique<uint32_t[]>(current_device, MaxNumModules);
auto d_id = cudautils::make_device_unique<uint16_t[]>(numElements, nullptr);
auto d_x = cudautils::make_device_unique<uint16_t[]>(numElements, nullptr);
auto d_y = cudautils::make_device_unique<uint16_t[]>(numElements, nullptr);
auto d_adc = cudautils::make_device_unique<uint16_t[]>(numElements, nullptr);
auto d_clus = cudautils::make_device_unique<int[]>(numElements, nullptr);
auto d_moduleStart = cudautils::make_device_unique<uint32_t[]>(MaxNumModules + 1, nullptr);
auto d_clusInModule = cudautils::make_device_unique<uint32_t[]>(MaxNumModules, nullptr);
auto d_moduleId = cudautils::make_device_unique<uint32_t[]>(MaxNumModules, nullptr);
#else

auto h_moduleStart = std::make_unique<uint32_t[]>(MaxNumModules + 1);
Expand Down

0 comments on commit f0ce448

Please sign in to comment.