NVIDIA Holoscan SDK v3.6.0

Program Listing for File cuda_green_context.hpp

Return to documentation for file (include/holoscan/core/resources/gxf/cuda_green_context.hpp)

Copy
Copied!
            

/* * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef HOLOSCAN_CORE_RESOURCES_GXF_CUDA_GREEN_CONTEXT_HPP #define HOLOSCAN_CORE_RESOURCES_GXF_CUDA_GREEN_CONTEXT_HPP #include <string> #include <gxf/std/cuda_green_context_pool.hpp> #include <gxf/std/cuda_green_context.hpp> #include "holoscan/core/resources/gxf/cuda_green_context_pool.hpp" #include "../../gxf/gxf_resource.hpp" #include "./allocator.hpp" namespace holoscan { class CudaGreenContext : public gxf::GXFResource { public: HOLOSCAN_RESOURCE_FORWARD_ARGS_SUPER(CudaGreenContext, gxf::GXFResource) CudaGreenContext() = default; CudaGreenContext(std::shared_ptr<CudaGreenContextPool> green_context_pool = nullptr, int32_t index = -1) : cuda_green_context_pool_(green_context_pool), index_(index) {} CudaGreenContext(const std::string& name, nvidia::gxf::CudaGreenContext* component); const char* gxf_typename() const override { return "nvidia::gxf::CudaGreenContext"; } void setup(ComponentSpec& spec) override; void initialize() override; nvidia::gxf::CudaGreenContext* get() const; private: Parameter<std::shared_ptr<CudaGreenContextPool>> cuda_green_context_pool_; Parameter<int32_t> index_; }; } // namespace holoscan #endif/* HOLOSCAN_CORE_RESOURCES_GXF_CUDA_GREEN_CONTEXT_HPP */

© Copyright 2022-2025, NVIDIA. Last updated on Sep 4, 2025.