Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Licensed under the MIT License.
#include <fstream>
#include <list>
#include <thread>
#include <unordered_set>
#include "core/providers/shared_library/provider_api.h"
#include "core/providers/nv_tensorrt_rtx/nv_provider_options.h"
Expand Down Expand Up @@ -1056,6 +1057,11 @@ NvExecutionProvider::NvExecutionProvider(const NvExecutionProviderInfo& info)
<< ", nv_op_types_to_exclude: " << op_types_to_exclude_;
}

Status NvExecutionProvider::Sync() const {
CUDA_RETURN_IF_ERROR(cudaStreamSynchronize(stream_));
return Status::OK();
}

NvExecutionProvider::~NvExecutionProvider() {
// clean up thread local context caches
{
Expand Down Expand Up @@ -1574,8 +1580,8 @@ SubGraphCollection_t NvExecutionProvider::GetSupportedList(SubGraphCollection_t
// the initializer was marked as external data by the ORT graph at load time since it was provided in memory
size_t size = 0;
const void* ptr = nullptr;
c_api.GetTensorSizeInBytes(&initializer_value, &size);
c_api.GetTensorData(&initializer_value, &ptr);
Ort::ThrowOnError(c_api.GetTensorSizeInBytes(&initializer_value, &size));
Ort::ThrowOnError(c_api.GetTensorData(&initializer_value, &ptr));
userWeights.emplace_back(tp->name(), ptr, size);
} else if (utils::HasExternalDataInMemory(*tp)) {
// only copy and take ownership of the data if none of the above conditions are met
Expand Down Expand Up @@ -2394,8 +2400,8 @@ Status NvExecutionProvider::CreateNodeComputeInfoFromGraph(const GraphViewer& gr
// the initializer was marked as external data by the ORT graph at load time since it was provided in memory
size_t size = 0;
const void* ptr = nullptr;
c_api.GetTensorSizeInBytes(&initializer_value, &size);
c_api.GetTensorData(&initializer_value, &ptr);
Ort::ThrowOnError(c_api.GetTensorSizeInBytes(&initializer_value, &size));
Ort::ThrowOnError(c_api.GetTensorData(&initializer_value, &ptr));
userWeights.emplace_back(tp->name(), ptr, size);
} else if (utils::HasExternalDataInMemory(*tp)) {
// only copy and take ownership of the data if none of the above conditions are met
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class NvExecutionProvider : public IExecutionProvider {
IResourceAccountant* /* resource_accountant */) const override;

int GetDeviceId() const { return device_id_; }
Status Sync() const;

common::Status Compile(const std::vector<FusedNodeAndGraph>& fused_nodes_and_graphs,
std::vector<NodeComputeInfo>& node_compute_funcs) override;
Expand Down
Loading