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
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/cpu/controlflow/loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static Status ConcatenateCpuOutput(void* /*stream*/,

// we can't easily use a C++ template for the tensor element type,
// so use a span for some protection but work in bytes
gsl::span<gsl::byte> output_span = gsl::make_span<gsl::byte>(static_cast<gsl::byte*>(output),
gsl::span<std::byte> output_span = gsl::make_span<std::byte>(static_cast<std::byte*>(output),
output_size_in_bytes);

for (size_t i = 0, num_iterations = per_iteration_output.size(); i < num_iterations; ++i) {
Expand All @@ -257,7 +257,7 @@ static Status ConcatenateCpuOutput(void* /*stream*/,
" Expected:", per_iteration_shape, " Got:", iteration_data.Shape());
}

auto src = gsl::make_span<const gsl::byte>(static_cast<const gsl::byte*>(iteration_data.DataRaw()),
auto src = gsl::make_span<const std::byte>(static_cast<const std::byte*>(iteration_data.DataRaw()),
bytes_per_iteration);
auto dst = output_span.subspan(i * bytes_per_iteration, bytes_per_iteration);
gsl::copy(src, dst);
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/cuda/controlflow/loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ static Status ConcatenateGpuOutput(void* stream, std::vector<OrtValue>& per_iter
CUDA_RETURN_IF_ERROR(cudaMemcpyAsync(cur_output, iteration_data.DataRaw(), bytes_per_iteration,
cudaMemcpyDeviceToDevice, static_cast<cudaStream_t>(stream)));

cur_output = static_cast<void*>((static_cast<gsl::byte*>(cur_output) + bytes_per_iteration));
cur_output = static_cast<void*>((static_cast<std::byte*>(cur_output) + bytes_per_iteration));
}

ORT_ENFORCE(static_cast<gsl::byte*>(cur_output) - static_cast<gsl::byte*>(output) == output_size_in_bytes,
ORT_ENFORCE(static_cast<std::byte*>(cur_output) - static_cast<std::byte*>(output) == output_size_in_bytes,
"Concatenation did not fill output buffer as expected.");

return Status::OK();
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/test/providers/base_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static std::unique_ptr<SparseTensor> MakeSparseTensor(MLDataType data_type, cons
return p_tensor;
}

void BaseTester::CopyDataToTensor(gsl::span<const gsl::byte> data, Tensor& dst) {
void BaseTester::CopyDataToTensor(gsl::span<const std::byte> data, Tensor& dst) {
ORT_ENFORCE(dst.SizeInBytes() >= data.size_bytes(), "Not enough space in the destination tensor");
memcpy(dst.MutableDataRaw(), data.data(), data.size_bytes());
}
Expand Down Expand Up @@ -203,7 +203,7 @@ void BaseTester::AddSparseCooTensorData(std::vector<Data>& data,
MLDataType data_type,
const char* name,
gsl::span<const int64_t> dims,
gsl::span<const gsl::byte> values,
gsl::span<const std::byte> values,
gsl::span<const int64_t> indices,
const ValidateOutputParams& check_params,
const std::vector<std::string>* dim_params) {
Expand Down Expand Up @@ -247,7 +247,7 @@ void BaseTester::AddSparseCsrTensorData(std::vector<Data>& data,
MLDataType data_type,
const char* name,
gsl::span<const int64_t> dims,
gsl::span<const gsl::byte> values,
gsl::span<const std::byte> values,
gsl::span<const int64_t> inner_indices,
gsl::span<const int64_t> outer_indices,
const ValidateOutputParams& check_params,
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/test/providers/base_tester.h
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ class BaseTester {
void AddShapeToTensorData(NodeArg& node_arg, gsl::span<const int64_t> dims,
const std::vector<std::string>* dim_params);

void CopyDataToTensor(gsl::span<const gsl::byte> data, Tensor& dst);
void CopyDataToTensor(gsl::span<const std::byte> data, Tensor& dst);

#if !defined(DISABLE_SPARSE_TENSORS)
NodeArg MakeSparseNodeArg(int32_t dtype, const char* name,
Expand All @@ -879,7 +879,7 @@ class BaseTester {
MLDataType data_type,
const char* name,
gsl::span<const int64_t> dims,
gsl::span<const gsl::byte> values,
gsl::span<const std::byte> values,
gsl::span<const int64_t> indices,
const ValidateOutputParams& check_params,
const std::vector<std::string>* dim_params = nullptr);
Expand All @@ -895,7 +895,7 @@ class BaseTester {
MLDataType data_type,
const char* name,
gsl::span<const int64_t> dims,
gsl::span<const gsl::byte> values,
gsl::span<const std::byte> values,
gsl::span<const int64_t> inner_indices,
gsl::span<const int64_t> outer_indices,
const ValidateOutputParams& check_params,
Expand Down
Loading