diff --git a/onnxruntime/core/providers/cuda/cuda_provider_factory.cc b/onnxruntime/core/providers/cuda/cuda_provider_factory.cc index 647fb98455..003dc57d61 100644 --- a/onnxruntime/core/providers/cuda/cuda_provider_factory.cc +++ b/onnxruntime/core/providers/cuda/cuda_provider_factory.cc @@ -52,7 +52,8 @@ std::unique_ptr CUDAProviderFactory::CreateProvider() { return std::make_unique(info_); } -struct ProviderInfo_CUDA_Impl : ProviderInfo_CUDA { +struct ProviderInfo_CUDA_Impl final : ProviderInfo_CUDA { + OrtStatus* SetCurrentGpuDeviceId(_In_ int device_id) override { int num_devices; auto cuda_err = ::cudaGetDeviceCount(&num_devices); diff --git a/onnxruntime/core/providers/cuda/tensor/transpose.cc b/onnxruntime/core/providers/cuda/tensor/transpose.cc index 17acc991a7..d056219a89 100644 --- a/onnxruntime/core/providers/cuda/tensor/transpose.cc +++ b/onnxruntime/core/providers/cuda/tensor/transpose.cc @@ -162,7 +162,7 @@ Status Transpose::DoTranspose(const cudaDeviceProp& prop, new_input_dims[prev] *= new_input_dims[curr]; new_input_dims[curr] = 1; for (auto j = static_cast(curr + 1); j < new_rank; j++) { - new_input_dims[j - 1] = new_input_dims[j]; + new_input_dims[static_cast(j) - 1] = new_input_dims[j]; } new_input_dims[new_rank - 1] = 1;