Skip to content

Commit

Permalink
Remove core/common/gsl.h (#20894)
Browse files Browse the repository at this point in the history
### Description
It might be easier if we just directly include the original gsl headers.
"core/common/gsl.h" is an indirection that doesn't provide extra help.
  • Loading branch information
snnn authored Jul 9, 2024
1 parent 4c3c809 commit 2c53b4a
Show file tree
Hide file tree
Showing 149 changed files with 148 additions and 154 deletions.
6 changes: 0 additions & 6 deletions include/onnxruntime/core/common/gsl.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/onnxruntime/core/common/logging/capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include <cstdarg>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/common/common.h"
#include "core/common/code_location.h"
#include "core/common/logging/severity.h"
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/common/span_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <algorithm>
#include <cstddef>

#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {

Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <type_traits>
#include <map>
#include <unordered_map>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/common/common.h"
#include "core/common/exceptions.h"
#include "core/framework/endian.h"
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/int4.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cassert>
#include <type_traits>
#include "core/common/common.h"
#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {

Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/op_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "core/graph/constants.h"
#include "core/graph/graph_viewer.h"
#include "core/graph/onnx_protobuf.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
namespace onnxruntime {
class OpKernelContext;
}
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/op_kernel_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "core/framework/ort_value.h"
#include "core/framework/op_node_proto_helper.h"
#include "core/graph/graph_viewer.h"
#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {

Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/op_node_proto_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "core/common/status.h"
#include "core/framework/tensor_shape.h"
#include "core/graph/graph_viewer.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#endif

class IMLOpKernel;
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>
#include <vector>

#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/common/common.h"
#include "core/framework/allocator.h"
#include "core/framework/tensor_shape.h"
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/framework/tensor_shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>
#include <vector>

#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/common/inlined_containers_fwd.h"
#include "core/common/span_utils.h"
#include "onnxruntime_config.h"
Expand Down
2 changes: 1 addition & 1 deletion include/onnxruntime/core/graph/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "core/common/flatbuffers.h"

#include "core/common/gsl.h"
#include <gsl/gsl>

#include "core/common/common.h"
#include "core/common/path_string.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/attnlstm/attention_mechanism.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {
namespace contrib {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/attnlstm/uni_dir_attn_lstm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "core/common/logging/logging.h"
#include "core/framework/allocator.h"

#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {
namespace contrib {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/crop.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "core/common/common.h"
#include "core/framework/op_kernel.h"

#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {
namespace contrib {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "core/mlas/inc/mlas.h"
#include "core/platform/threadpool.h"
#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {
namespace contrib {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/transformers/beam_search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "core/framework/TensorSeq.h"
#include "core/framework/allocator.h"
#include "core/framework/ort_value.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/beam_search.h"
#include "contrib_ops/cpu/transformers/logits_processor.h"
#include "contrib_ops/cpu/transformers/sequences.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "core/providers/cpu/math/softmax_shared.h"
#include "core/providers/cpu/generator/random.h"
#include "core/common/safeint.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/sequences.h"
#include "contrib_ops/cpu/transformers/beam_search_scorer.h"
#include "contrib_ops/cpu/transformers/generation_device_helper.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#endif

#include <vector>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/logits_processor.h"
#include "contrib_ops/cpu/transformers/generation_shared.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <utility>
#include <random>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/framework/allocator.h"
#include "core/framework/ort_value.h"
#include "contrib_ops/cpu/utils/debug_macros.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/transformers/greedy_search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "core/framework/session_options.h"
#include "core/framework/TensorSeq.h"
#include "core/framework/ort_value.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/greedy_search.h"
#include "contrib_ops/cpu/transformers/logits_processor.h"
#include "contrib_ops/cpu/transformers/sequences.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/transformers/sequences.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/generation_shared.h"

namespace onnxruntime {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/transformers/subgraph_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/subgraph_base.h"
#include "contrib_ops/cpu/utils/dump_tensor.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/transformers/subgraph_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <vector>
#include <string>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/framework/allocator.h"
#include "core/framework/feeds_fetches_manager.h"
#include "contrib_ops/cpu/transformers/generation_device_helper.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cpu/transformers/subgraph_gpt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/subgraph_gpt.h"
#include "contrib_ops/cpu/utils/dump_tensor.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/subgraph_t5_decoder.h"
#include "contrib_ops/cpu/utils/dump_tensor.h"
#include "contrib_ops/cpu/transformers/generation_device_helper.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/subgraph_t5_encoder.h"

namespace onnxruntime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/subgraph_t5_decoder.h"
#include "contrib_ops/cpu/transformers/subgraph_whisper_decoder.h"
#include "contrib_ops/cpu/utils/dump_tensor.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "core/framework/tensorprotoutils.h"
#include "core/framework/utils.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/subgraph_t5_encoder.h"
#include "contrib_ops/cpu/transformers/subgraph_whisper_encoder.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cuda/bert/attention_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cuda_fp16.h>
#include <cublas_v2.h>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/framework/allocator.h"
#include "contrib_ops/cpu/bert/attention_common.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/cuda/collective/sharding_spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "sharding_spec.h"

#include "core/common/common.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/framework/tensor_shape.h"

#include <cctype>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "core/providers/cpu/tensor/utils.h"
#include "core/providers/cuda/cuda_common.h"

#include "core/common/gsl.h"
#include <gsl/gsl>
#include "contrib_ops/cpu/transformers/sequences.h"
#include "contrib_ops/cpu/transformers/generation_shared.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/mti/mti_tvm_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <string>
#include <vector>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include <tvm/tvm.h>
#include "core/codegen/mti/common.h"

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/mti/tensor/concat_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "core/codegen/mti/tensor/concat_ops.h"

#include "core/codegen/mti/mti_tvm_utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include <topi/transform.h>

namespace onnxruntime {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/mti/tensor/gather.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "core/codegen/mti/tensor/gather.h"

#include "core/codegen/mti/mti_tvm_utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include <topi/transform.h>

namespace onnxruntime {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/mti/tensor/slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "core/codegen/mti/mti_tvm_utils.h"
#include <climits>
#include "core/common/gsl.h"
#include <gsl/gsl>
#include <topi/transform.h>
#include <tvm/ir_pass.h>

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/mti/tensor/split.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "core/codegen/mti/tensor/split.h"

#include "core/codegen/mti/mti_tvm_utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include <topi/transform.h>

namespace onnxruntime {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/mti/tensor/tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "core/codegen/mti/tensor/tile.h"
#include "core/codegen/mti/mti_tvm_utils.h"
#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {
namespace tvm_codegen {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/codegen/passes/utils/ort_tvm_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "core/codegen/passes/utils/codegen_context.h"
#include "core/framework/tensorprotoutils.h"
#include "core/providers/common.h"
#include "core/common/gsl.h"
#include <gsl/gsl>

#include <topi/detail/extern.h>

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/common/logging/capture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "core/common/logging/capture.h"
#include "core/common/logging/logging.h"
#include "core/common/gsl.h"
#include <gsl/gsl>

namespace onnxruntime {
namespace logging {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/flatbuffers/flatbuffers_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "core/flatbuffers/flatbuffers_utils.h"

#include "core/common/common.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/flatbuffers/schema/ort.fbs.h"
#include "core/graph/constants.h"
#include "core/graph/onnx_protobuf.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/framework/data_transfer_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <type_traits>

#include "core/common/gsl.h"
#include <gsl/gsl>

#include "core/common/common.h"
#include "core/framework/tensor.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/framework/endian_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <type_traits>

#include "core/common/gsl.h"
#include <gsl/gsl>

#include "core/common/status.h"
#include "core/common/common.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/framework/fallback_cpu_capability.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once

#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/common/inlined_containers_fwd.h"
#include "core/framework/execution_provider.h" // for IExecutionProvider::IKernelLookup
#include "core/graph/graph_viewer.h"
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/framework/kernel_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include "core/common/common.h"
#include "core/common/gsl.h"
#include <gsl/gsl>
#include "core/framework/execution_provider.h" // for IExecutionProvider::IKernelLookup
#include "core/framework/kernel_registry.h"
#include "core/framework/kernel_type_str_resolver.h"
Expand Down
Loading

0 comments on commit 2c53b4a

Please sign in to comment.