Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyShuai committed Aug 9, 2023
1 parent ec27703 commit cc17d1d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/onnxruntime/core/providers/cuda/cuda_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ enum CudaResource : int {
cuda_stream_t = cuda_resource_offset,
cudnn_handle_t,
cublas_handle_t
};
};
2 changes: 1 addition & 1 deletion include/onnxruntime/core/providers/dml/dml_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ enum DmlResource : int {
d3d12_device_t,
cmd_list_t,
cmd_recorder_t
};
};
1 change: 0 additions & 1 deletion include/onnxruntime/core/providers/rocm/rocm_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ enum RocmResource : int {
miopen_handle_t,
rocblas_handle_t
};

3 changes: 3 additions & 0 deletions onnxruntime/core/session/custom_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetResource, _In_ const OrtKernelCont
*resource = {};
const auto* ctx = reinterpret_cast<const onnxruntime::OpKernelContext*>(context);
auto* stream = reinterpret_cast<onnxruntime::Stream*>(ctx->GetComputeStream());
if (!stream) {
return OrtApis::CreateStatus(ORT_INVALID_ARGUMENT, "Failed to fetch a stream hosting the requested resource");
}
*resource = stream->GetResource(resource_version, resource_id);
if (!(*resource)) {
return OrtApis::CreateStatus(ORT_INVALID_ARGUMENT, "Requested resource does not exist");
Expand Down

0 comments on commit cc17d1d

Please sign in to comment.