Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Share `RuntimeConfig` with `Arc`, so `ExecutionContext` can move between threads.

### Removed

- Removed all deprecated Rust API methods, including the old getter aliases and
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["trtx-sys", "trtx", "trtexec-rs"]
resolver = "2"

[workspace.package]
version = "0.9.1+rtx1.7"
version = "0.9.2+rtx1.7"
edition = "2021"
license = "Apache-2.0"
authors = ["Tarek Ziade", "Markus Tavenrath", "Stephan Seitz"]
Expand Down
6 changes: 3 additions & 3 deletions trtexec-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors.workspace = true
repository.workspace = true

[dependencies]
rustnn = { git = "https://github.com/theHamsta/rustnn/", branch = "bump-trtx-v0.9.0", features = [
rustnn = { git = "https://github.com/shubhamg13/rustnn/", branch = "fix/trtx-send", features = [
"trtx-runtime",
], default-features = false, optional = true }

Expand All @@ -17,8 +17,8 @@ pretty_env_logger = "0.5"

# To upgrade the trtx version to new major version, create a PR with that bump to the RustNN repo
# and switch the RustNN dep temporarily to that branch until RustNN main has that version bump
trtx = { version = "0.9.1", path = "../trtx", default-features = true }
trtx-sys = { version = "0.9.1", path = "../trtx-sys", default-features = true }
trtx = { version = "0.9.2", path = "../trtx", default-features = true }
trtx-sys = { version = "0.9.2", path = "../trtx-sys", default-features = true }
indicatif = "0.18"
anyhow = { version = "1.0", features = ["backtrace"] }
clap = { version = "4.6", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion trtx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords = ["tensorrt", "inference", "deep-learning", "nvidia", "gpu"]
categories = ["api-bindings", "science"]

[dependencies]
trtx-sys = { version = "0.9.1", path = "../trtx-sys", default-features = false }
trtx-sys = { version = "0.9.2", path = "../trtx-sys", default-features = false }
thiserror = "2.0"
cxx = "1.0"
libloading = { version = "0.9", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions trtx/src/cuda_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [`CudaEngine`] wraps [`nvinfer1::ICudaEngine`] (C++ [`nvinfer1::ICudaEngine`](https://docs.nvidia.com/deeplearning/tensorrt-rtx/latest/_static/c-api/classnvinfer1_1_1_i_cuda_engine.html)).
//! [`SerializationConfig`] wraps [`nvinfer1::ISerializationConfig`] (C++ [`nvinfer1::ISerializationConfig`](https://docs.nvidia.com/deeplearning/tensorrt-rtx/latest/_static/c-api/classnvinfer1_1_1_i_serialization_config.html)).

use std::rc::Rc;
use std::sync::Arc;
#[cfg(all(feature = "v_1_6", not(feature = "enterprise")))]
use std::{ffi::c_void, pin::Pin};
use std::{ffi::CStr, marker::PhantomData};
Expand Down Expand Up @@ -353,7 +353,7 @@ impl<'engine> CudaEngine<'engine> {
/// See [nvinfer1::ICudaEngine::createExecutionContext1]
pub fn create_execution_context_with_config(
&'_ mut self,
runtime_config: Rc<RuntimeConfig<'engine>>,
runtime_config: Arc<RuntimeConfig<'engine>>,
) -> Result<ExecutionContext<'engine>> {
#[cfg(not(feature = "mock_runtime"))]
{
Expand Down
6 changes: 3 additions & 3 deletions trtx/src/execution_context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ffi::{CStr, CString};
use std::pin::Pin;
use std::rc::Rc;
use std::sync::Arc;

use cxx::UniquePtr;
use trtx_sys::nvinfer1;
Expand All @@ -20,7 +20,7 @@ use crate::RuntimeConfig;
/// pointers before their Rust wrappers run destructors.
pub struct ExecutionContext<'engine> {
_engine: std::marker::PhantomData<&'engine CudaEngine<'engine>>,
_config: Option<Rc<RuntimeConfig<'engine>>>,
_config: Option<Arc<RuntimeConfig<'engine>>>,
debug_listener: Option<Pin<Box<DebugListener>>>,
profiler: Option<Pin<Box<Profiler>>>,
error_recorder: Option<Pin<Box<ErrorRecorder>>>,
Expand All @@ -38,7 +38,7 @@ impl std::fmt::Debug for ExecutionContext<'_> {
impl<'engine> ExecutionContext<'engine> {
pub(crate) unsafe fn from_ptr(
execution_context: *mut nvinfer1::IExecutionContext,
config: Option<Rc<RuntimeConfig<'engine>>>,
config: Option<Arc<RuntimeConfig<'engine>>>,
) -> Result<Self> {
#[cfg(not(feature = "mock_runtime"))]
if execution_context.is_null() {
Expand Down