NVIDIA Holoscan SDK v3.6.0

Class CudaGreenContextPool

Base Type

class CudaGreenContextPool : public holoscan::gxf::GXFResource

CUDA green context pool.

A resource component that creates a pool of CUDA green contexts.

Internally, the green contexts created correspond to nvidia::gxf::CudaGreenContext objects whose lifetime is managed by the underlying GXF framework.

==Parameters==

  • dev_id (int32_t, optional): The CUDA device id specifying which device the green context pool will use (Default: 0).

  • flags (uint32_t, optional): The flags passed to the underlying CUDA runtime API call when the green contexts for this pool are created (Default: 0).

  • num_partitions (uint32_t, optional): The number of partitions to create for the green context pool (Default: 1).

  • sms_per_partition (std::vector<uint32_t>, optional): The number of SMs to allocate per partition. If empty, and num_partitions is 0, one green context will be created using all the SMs available on the device.

  • default_context_index (int32_t, optional): The index of the default green context to use. When index < 0, the last partition’s index will be used. (Default: -1).

  • min_sm_size (uint32_t, optional): The minimum number of SMs to allocate per partition. (Default: 2).

Public Functions

template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Resource, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>
inline explicit CudaGreenContextPool(ArgT &&arg, ArgsT&&... args)
CudaGreenContextPool() = default
inline CudaGreenContextPool(int32_t dev_id, uint32_t flags, uint32_t num_partitions, std::vector<uint32_t> sms_per_partition = {}, int32_t default_context_index = -1, uint32_t min_sm_size = 2)
CudaGreenContextPool(const std::string &name, nvidia::gxf::CudaGreenContextPool *component)
inline virtual const char *gxf_typename() const override
virtual void setup(ComponentSpec &spec) override

Define the resource specification.

Parameters

spec – The reference to the component specification.

nvidia::gxf::CudaGreenContextPool *get() const

Previous Class CudaGreenContext
Next Class CudaObjectHandler
© Copyright 2022-2025, NVIDIA. Last updated on Sep 4, 2025.