NVIDIA Holoscan SDK v3.6.0

Class CudaGreenContext

Base Type

class CudaGreenContext : public holoscan::gxf::GXFResource

CUDA green context.

A resource component that creates a CUDA green context.

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

==Parameters==

  • green_context_pool (CudaGreenContextPool): The CUDA green context pool to use.

  • index (uint32_t, optional): The index of the green context to use, When not specified, the default green context will be used.

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 CudaGreenContext(ArgT &&arg, ArgsT&&... args)
CudaGreenContext() = default
inline CudaGreenContext(std::shared_ptr<CudaGreenContextPool> green_context_pool = nullptr, int32_t index = -1)
CudaGreenContext(const std::string &name, nvidia::gxf::CudaGreenContext *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.

virtual void initialize() override

Initialize the component.

This method is called only once when the component is created for the first time, and use of light-weight initialization.

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

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