From a4bdfdad210199fb485eafe62443f1fb70322fce Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 15 Feb 2022 12:22:42 -0600 Subject: [PATCH] Replace auto_ptr -> unique_ptr --- src/cpp/cuda.hpp | 8 ++++---- src/cpp/cuda_gl.hpp | 2 +- src/wrapper/mempool.cpp | 2 +- src/wrapper/wrap_cudadrv.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cpp/cuda.hpp b/src/cpp/cuda.hpp index 2099a2ed..f60bb1d9 100644 --- a/src/cpp/cuda.hpp +++ b/src/cpp/cuda.hpp @@ -1320,7 +1320,7 @@ namespace pycuda { CUtexref tr; CUDAPP_CALL_GUARDED(cuModuleGetTexRef, (&tr, mod->handle(), name)); - std::auto_ptr result( + std::unique_ptr result( new texture_reference(tr, false)); result->set_module(mod); return result.release(); @@ -1333,7 +1333,7 @@ namespace pycuda { CUsurfref sr; CUDAPP_CALL_GUARDED(cuModuleGetSurfRef, (&sr, mod->handle(), name)); - std::auto_ptr result( + std::unique_ptr result( new surface_reference(sr)); result->set_module(mod); return result.release(); @@ -1613,13 +1613,13 @@ namespace pycuda }; inline Py_ssize_t mem_alloc_pitch( - std::auto_ptr &da, + std::unique_ptr &da, unsigned int width, unsigned int height, unsigned int access_size) { CUdeviceptr devptr; pycuda_size_t pitch; CUDAPP_CALL_GUARDED(cuMemAllocPitch, (&devptr, &pitch, width, height, access_size)); - da = std::auto_ptr(new device_allocation(devptr)); + da = std::unique_ptr(new device_allocation(devptr)); return pitch; } diff --git a/src/cpp/cuda_gl.hpp b/src/cpp/cuda_gl.hpp index 8f2aa7f0..04b7dd86 100644 --- a/src/cpp/cuda_gl.hpp +++ b/src/cpp/cuda_gl.hpp @@ -294,7 +294,7 @@ namespace pycuda { namespace gl { CUarray devptr; CUDAPP_CALL_GUARDED(cuGraphicsSubResourceGetMappedArray, (&devptr, m_object->resource(), index, level)); - std::auto_ptr result( + std::unique_ptr result( new pycuda::array(devptr, false)); return result.release(); } diff --git a/src/wrapper/mempool.cpp b/src/wrapper/mempool.cpp index 66f43f7e..d889d516 100644 --- a/src/wrapper/mempool.cpp +++ b/src/wrapper/mempool.cpp @@ -192,7 +192,7 @@ namespace py::stl_input_iterator(), back_inserter(dims)); - std::auto_ptr alloc( + std::unique_ptr alloc( new pooled_host_allocation( pool, tp_descr->elsize*pycuda::size_from_dims(dims.size(), &dims.front()))); diff --git a/src/wrapper/wrap_cudadrv.cpp b/src/wrapper/wrap_cudadrv.cpp index e16d777d..457820a6 100644 --- a/src/wrapper/wrap_cudadrv.cpp +++ b/src/wrapper/wrap_cudadrv.cpp @@ -118,7 +118,7 @@ namespace py::tuple mem_alloc_pitch_wrap( size_t width, size_t height, unsigned int access_size) { - std::auto_ptr da; + std::unique_ptr da; Py_ssize_t pitch = mem_alloc_pitch( da, width, height, access_size); return py::make_tuple( @@ -571,7 +571,7 @@ namespace py::stl_input_iterator(), back_inserter(dims)); - std::auto_ptr alloc( + std::unique_ptr alloc( new Allocation( tp_descr->elsize*pycuda::size_from_dims(dims.size(), &dims.front()), par1) @@ -612,7 +612,7 @@ namespace throw pycuda::error("register_host_memory", CUDA_ERROR_INVALID_VALUE, "ary argument is not contiguous"); - std::auto_ptr regmem( + std::unique_ptr regmem( new registered_host_memory( PyArray_DATA(ary.ptr()), PyArray_NBYTES(ary.ptr()), flags, ary)); -- GitLab