diff --git a/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.h b/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.h index e22a9e81e12b5..61761c566eaad 100644 --- a/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.h +++ b/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.h @@ -14,7 +14,6 @@ namespace onnxruntime { namespace contrib { namespace cuda { -using namespace onnxruntime::cuda; template class MatMulNBits final : public CudaKernel { diff --git a/onnxruntime/core/optimizer/gpu_ops_prepack.cc b/onnxruntime/core/optimizer/gpu_ops_prepack.cc index 484f6c42ba5a9..149b44378236f 100644 --- a/onnxruntime/core/optimizer/gpu_ops_prepack.cc +++ b/onnxruntime/core/optimizer/gpu_ops_prepack.cc @@ -24,6 +24,8 @@ // 3. The logic of prepacking depends on underlying GPU // hardware. Currently this part is hard-coded for SM80. +#if defined(USE_CUDA) && !defined(USE_ROCM) + #include "core/graph/graph_utils.h" #include "core/optimizer/initializer.h" #include "core/optimizer/gpu_ops_prepack.h" @@ -48,7 +50,8 @@ inline Status GetOrtValue(const NodeArg* arg, const Graph& graph, OrtValue& ort_ ORT_RETURN_IF_NOT(graph.GetInitializedTensor(arg->Name(), tensor_proto), "Missing initializer for ", arg->Name()); - const auto path_str = graph.ModelPath().ToPathString(); + const onnxruntime::Path& graph_path = graph.ModelPath(); + const auto path_str = graph_path.ToPathString(); return utils::TensorProtoToOrtValue( Env::Default(), path_str.c_str(), *tensor_proto, @@ -322,3 +325,5 @@ Status GpuOpsPrepack::ApplyImpl(Graph& graph, bool& modified, int graph_level, c } } // namespace onnxruntime + +#endif // USE_CUDA && !USE_ROCM diff --git a/onnxruntime/core/optimizer/gpu_ops_prepack.h b/onnxruntime/core/optimizer/gpu_ops_prepack.h index d6770a2bfb1cb..0beecde4021d9 100644 --- a/onnxruntime/core/optimizer/gpu_ops_prepack.h +++ b/onnxruntime/core/optimizer/gpu_ops_prepack.h @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#if defined(USE_CUDA) && !defined(USE_ROCM) + #pragma once #include "core/optimizer/graph_transformer.h" @@ -22,3 +24,5 @@ class GpuOpsPrepack : public GraphTransformer { }; } // namespace onnxruntime + +#endif // USE_CUDA && !USE_ROCM