NVIDIA Holoscan SDK v0.5.1
Holoscan v0.5.1

Program Listing for File holoinfer_utils.hpp

Return to documentation for file (modules/holoinfer/src/include/holoinfer_utils.hpp)

Copy
Copied!
            

/* * SPDX-FileCopyrightText: Copyright (c) 2022-2023 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_INFER_UTILS_API_H #define _HOLOSCAN_INFER_UTILS_API_H #include <sys/utsname.h> #include <filesystem> #include <map> #include <string> #include <vector> #include "gxf/core/entity.hpp" #include "gxf/core/gxf.h" #include "gxf/core/parameter.hpp" #include "gxf/cuda/cuda_stream.hpp" #include "gxf/cuda/cuda_stream_id.hpp" #include "gxf/cuda/cuda_stream_pool.hpp" #include "gxf/multimedia/video.hpp" #include "gxf/std/allocator.hpp" #include "gxf/std/clock.hpp" #include "gxf/std/codelet.hpp" #include "gxf/std/parameter_parser_std.hpp" #include "gxf/std/receiver.hpp" #include "gxf/std/tensor.hpp" #include "gxf/std/timestamp.hpp" #include "gxf/std/transmitter.hpp" #include "holoinfer_buffer.hpp" #include "holoinfer_constants.hpp" namespace holoscan { namespace inference { void timer_init(TimePoint& _t); using GXFTransmitters = std::vector<nvidia::gxf::Handle<nvidia::gxf::Transmitter>>; using GXFReceivers = std::vector<nvidia::gxf::Handle<nvidia::gxf::Receiver>>; gxf_result_t _HOLOSCAN_EXTERNAL_API_ multiai_get_data_per_model( const GXFReceivers& receivers, const std::vector<std::string>& in_tensors, DataMap& data_per_tensor, std::map<std::string, std::vector<int>>& dims_per_tensor, bool cuda_buffer_out, const std::string& module); gxf_result_t _HOLOSCAN_EXTERNAL_API_ multiai_transmit_data_per_model( gxf_context_t& context, const Mappings& model_map, DataMap& data_map, const GXFTransmitters& transmitters, const std::vector<std::string>& out_tensors, DimType& out_dims_map, bool in_on_cuda, bool out_on_cuda, const nvidia::gxf::PrimitiveType& element_type, const std::string& module, const nvidia::gxf::Handle<nvidia::gxf::Allocator>& allocator); InferStatus map_data_to_model_from_tensor(const MultiMappings& model_data_mapping, DataMap& data_per_model, DataMap& data_per_input_tensor); gxf_result_t _HOLOSCAN_EXTERNAL_API_ report_error(const std::string& module, const std::string& submodule); void _HOLOSCAN_EXTERNAL_API_ raise_error(const std::string& module, const std::string& submodule); InferStatus multiai_inference_validity_check(const Mappings& model_path_map, const MultiMappings& pre_processor_map, const Mappings& inference_map, const std::vector<std::string>& in_tensor_names, const std::vector<std::string>& out_tensor_names); InferStatus multiai_processor_validity_check(const Mappings& processed_map, const std::vector<std::string>& in_tensor_names, const std::vector<std::string>& out_tensor_names); bool is_platform_aarch64(); } // namespace inference } // namespace holoscan #endif

© Copyright 2022-2023, NVIDIA. Last updated on Jul 28, 2023.