void CudaSynchronizedMemory<T>::init(unsigned N, bool pageLocked) { try { if(pageLocked) { cudaError_t e = cudaMallocHost((void**)&m_host,N*sizeof(T)); ASRL_ASSERT_EQ(e, cudaSuccess, "Unable to allocate page-locked host memory for " << N << " elements of type " << typeid(T).name() << ": " << cudaGetErrorString(e)); } else { try { m_host = new T[N]; } catch(std::exception const & e) { ASRL_THROW( "Unable to allocate host memory for " << N << " elements of type " << typeid(T).name() << ": " << e.what()); } } cudaError_t err = cudaMalloc((void**)&m_device,N*sizeof(T)); ASRL_ASSERT_EQ(err, cudaSuccess, "Unable to allocate device memory for " << N << " elements of type " << typeid(T).name() << ": " << cudaGetErrorString(err)); m_size = N; m_pageLocked = pageLocked; } catch(std::exception const &) { reset(); throw; } }
void GpuSurfDetectorInternal::computeUprightDescriptors() { ASRL_THROW("Not implemented"); }