pcod-common v1.0.0
Shared preprocessing and postprocessing for point-cloud object detection
Loading...
Searching...
No Matches
pcod_common::PillarPreprocessCudaContext Class Reference

#include <pillar_preprocess_cuda.hpp>

Classes

struct  Impl
 

Public Member Functions

 PillarPreprocessCudaContext ()
 
 ~PillarPreprocessCudaContext ()
 
 PillarPreprocessCudaContext (const PillarPreprocessCudaContext &)=delete
 
PillarPreprocessCudaContextoperator= (const PillarPreprocessCudaContext &)=delete
 
 PillarPreprocessCudaContext (PillarPreprocessCudaContext &&other) noexcept
 
PillarPreprocessCudaContextoperator= (PillarPreprocessCudaContext &&other) noexcept
 
bool isAvailable () const
 
bool run (const PillarPreprocessPoint *points, std::int32_t num_points, const PillarPreprocessCudaConfig &config, const PillarPreprocessCudaOutputs &outputs, std::string *error_message)
 
bool runToDevice (const PillarPreprocessPoint *points, std::int32_t num_points, const PillarPreprocessCudaConfig &config, const PillarPreprocessCudaDeviceOutputs &outputs, std::string *error_message)
 

Detailed Description

Own the reusable CUDA resources required for pillar preprocessing.

Definition at line 67 of file pillar_preprocess_cuda.hpp.

Constructor & Destructor Documentation

◆ PillarPreprocessCudaContext() [1/3]

pcod_common::PillarPreprocessCudaContext::PillarPreprocessCudaContext ( )

Construct a context, retaining an unavailable state when CUDA initialization fails.

Definition at line 12 of file pillar_preprocess_cuda_stub.cpp.

12: impl_(std::make_unique<Impl>()) {}

◆ ~PillarPreprocessCudaContext()

pcod_common::PillarPreprocessCudaContext::~PillarPreprocessCudaContext ( )
default

Release all owned CUDA resources.

◆ PillarPreprocessCudaContext() [2/3]

pcod_common::PillarPreprocessCudaContext::PillarPreprocessCudaContext ( const PillarPreprocessCudaContext & )
delete

Copy construction is disabled because the context owns backend resources.

◆ PillarPreprocessCudaContext() [3/3]

pcod_common::PillarPreprocessCudaContext::PillarPreprocessCudaContext ( PillarPreprocessCudaContext && other)
defaultnoexcept
Parameters
otherContext whose resources are transferred.

Member Function Documentation

◆ isAvailable()

bool pcod_common::PillarPreprocessCudaContext::isAvailable ( ) const

Return whether this context can execute CUDA preprocessing.

Definition at line 20 of file pillar_preprocess_cuda_stub.cpp.

20{ return impl_ != nullptr && HasCudaPillarPreprocessSupport(); }

References pcod_common::HasCudaPillarPreprocessSupport().

◆ operator=() [1/2]

PillarPreprocessCudaContext & pcod_common::PillarPreprocessCudaContext::operator= ( const PillarPreprocessCudaContext & )
delete

Copy assignment is disabled because the context owns backend resources.

◆ operator=() [2/2]

PillarPreprocessCudaContext & pcod_common::PillarPreprocessCudaContext::operator= ( PillarPreprocessCudaContext && other)
defaultnoexcept
Parameters
otherContext whose resources are transferred.
Returns
This context.

◆ run()

bool pcod_common::PillarPreprocessCudaContext::run ( const PillarPreprocessPoint * points,
std::int32_t num_points,
const PillarPreprocessCudaConfig & config,
const PillarPreprocessCudaOutputs & outputs,
std::string * error_message )

Run preprocessing and copy results to host-accessible buffers.

Parameters
pointsHost input point array.
num_pointsNumber of input points.
configPreprocessing contract.
outputsHost output buffers.
error_messageOptional failure detail destination.
Returns
Whether preprocessing completed successfully.

Definition at line 22 of file pillar_preprocess_cuda_stub.cpp.

26 {
27 (void)points;
28 (void)num_points;
29 (void)config;
30 (void)outputs;
31 if (error_message != nullptr) {
32 *error_message =
33 impl_ == nullptr ? "CUDA preprocessing context is not initialized" : "CUDA preprocessing is not available in this build";
34 }
35 return false;
36}

◆ runToDevice()

bool pcod_common::PillarPreprocessCudaContext::runToDevice ( const PillarPreprocessPoint * points,
std::int32_t num_points,
const PillarPreprocessCudaConfig & config,
const PillarPreprocessCudaDeviceOutputs & outputs,
std::string * error_message )

Run preprocessing directly into device-resident buffers.

Parameters
pointsHost input point array.
num_pointsNumber of input points.
configPreprocessing contract.
outputsDevice output buffers.
error_messageOptional failure detail destination.
Returns
Whether preprocessing completed successfully.

Definition at line 38 of file pillar_preprocess_cuda_stub.cpp.

42 {
43 (void)points;
44 (void)num_points;
45 (void)config;
46 (void)outputs;
47 if (error_message != nullptr) {
48 *error_message =
49 impl_ == nullptr ? "CUDA preprocessing context is not initialized" : "CUDA preprocessing is not available in this build";
50 }
51 return false;
52}

The documentation for this class was generated from the following files: