mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Fix a few warnings
This commit is contained in:
parent
3bdb0b620a
commit
8f00147c14
6 changed files with 9 additions and 14 deletions
|
|
@ -128,7 +128,7 @@ Status MatMulInteger<int8_t, int8_t>::ComputeInternal(OpKernelContext* ctx) cons
|
|||
b_pad_size,
|
||||
b_padded));
|
||||
|
||||
for (int batch = 0; batch < helper.OutputOffsets().size(); batch++) {
|
||||
for (size_t batch = 0; batch < helper.OutputOffsets().size(); batch++) {
|
||||
CUBLAS_RETURN_IF_ERROR(cublasGemmEx(
|
||||
Base::CublasHandle(),
|
||||
CUBLAS_OP_N,
|
||||
|
|
|
|||
|
|
@ -130,8 +130,7 @@ Status Conv<T>::ComputeInternal(OpKernelContext* context) const {
|
|||
std::vector<int64_t> b_dims(2 + kernel_shape.size());
|
||||
b_dims[0] = 1; // N
|
||||
b_dims[1] = b_shape[0]; // C
|
||||
for (auto i = 0; i < kernel_shape.size(); i++)
|
||||
b_dims[2 + i] = 1;
|
||||
for (size_t i = 0; i < kernel_shape.size(); i++) b_dims[2 + i] = 1;
|
||||
|
||||
ORT_RETURN_IF_ERROR(s_.b_tensor.Set(b_dims, CudnnTensor::GetDataType<CudaT>()));
|
||||
}
|
||||
|
|
@ -229,7 +228,7 @@ Status CudnnConvolutionDescriptor::Set(
|
|||
std::vector<int> pad_dims(rank);
|
||||
std::vector<int> stride_dims(rank);
|
||||
std::vector<int> dilation_dims(rank);
|
||||
for (auto i = 0; i < rank; i++) {
|
||||
for (size_t i = 0; i < rank; i++) {
|
||||
pad_dims[i] = gsl::narrow_cast<int>(pads[i]);
|
||||
stride_dims[i] = gsl::narrow_cast<int>(strides[i]);
|
||||
dilation_dims[i] = gsl::narrow_cast<int>(dilations[i]);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include "core/providers/cuda/shared_inc/cuda_utils.h"
|
||||
#include "core/providers/cuda/cu_inc/common.cuh"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ Status CudaQuantizeLinear(const float* input, T* output, const float* scale, con
|
|||
return Status::OK();
|
||||
|
||||
int blocksPerGrid = static_cast<int>(CeilDiv(num_of_element, GridDim::maxThreadsPerBlock * GridDim::maxElementsPerThread));
|
||||
CUDA_LONG N = static_cast<CUDA_LONG>(num_of_element);
|
||||
QuantizeLinearKernel<GridDim::maxThreadsPerBlock, GridDim::maxElementsPerThread>
|
||||
<<<blocksPerGrid, GridDim::maxThreadsPerBlock, 0>>>(
|
||||
input,
|
||||
|
|
@ -72,7 +71,6 @@ Status CudaDequantizeLinear(const T* input, float* output, const float* scale, c
|
|||
return Status::OK();
|
||||
|
||||
int blocksPerGrid = static_cast<int>(CeilDiv(num_of_element, GridDim::maxThreadsPerBlock * GridDim::maxElementsPerThread));
|
||||
CUDA_LONG N = static_cast<CUDA_LONG>(num_of_element);
|
||||
DequantizeLinearKernel<T, GridDim::maxThreadsPerBlock, GridDim::maxElementsPerThread>
|
||||
<<<blocksPerGrid, GridDim::maxThreadsPerBlock, 0>>>(
|
||||
input,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include "core/providers/cuda/shared_inc/cuda_utils.h"
|
||||
#include "core/providers/cuda/cu_inc/common.cuh"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ TEST(CApiTest, CreateGetVectorOfMapsInt64Float) { // support zipmap output type
|
|||
std::vector<int64_t> keys{3, 1, 2, 0};
|
||||
std::vector<int64_t> dims = {4};
|
||||
std::vector<float> values{3.0f, 1.0f, 2.f, 0.f};
|
||||
for (int i = 0; i < N; ++i) {
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
// create key tensor
|
||||
Ort::Value keys_tensor = Ort::Value::CreateTensor(info, keys.data(), keys.size() * sizeof(int64_t),
|
||||
dims.data(), dims.size(), ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64);
|
||||
|
|
@ -65,8 +65,8 @@ TEST(CApiTest, CreateGetVectorOfMapsInt64Float) { // support zipmap output type
|
|||
ASSERT_EQ(failed, true);
|
||||
|
||||
// Fetch
|
||||
for (int idx = 0; idx < N; ++idx) {
|
||||
Ort::Value map_out = seq_ort.GetValue(idx, default_allocator.get());
|
||||
for (size_t idx = 0; idx < N; ++idx) {
|
||||
Ort::Value map_out = seq_ort.GetValue(static_cast<int>(idx), default_allocator.get());
|
||||
|
||||
// fetch the map
|
||||
// first fetch the keys
|
||||
|
|
@ -97,7 +97,7 @@ TEST(CApiTest, CreateGetVectorOfMapsStringFloat) { // support zipmap output typ
|
|||
std::vector<std::string> keys{keys_arr, keys_arr + NUM_KV_PAIRS};
|
||||
std::vector<int64_t> dims = {NUM_KV_PAIRS};
|
||||
std::vector<float> values{3.0f, 1.0f, 2.f, 0.f};
|
||||
for (int i = 0; i < N; ++i) {
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
// create key tensor
|
||||
Ort::Value keys_tensor = Ort::Value::CreateTensor(info, keys.data(), keys.size() * sizeof(std::string),
|
||||
dims.data(), dims.size(), ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING);
|
||||
|
|
@ -118,8 +118,8 @@ TEST(CApiTest, CreateGetVectorOfMapsStringFloat) { // support zipmap output typ
|
|||
ASSERT_EQ(num_values, N);
|
||||
|
||||
// Fetch
|
||||
for (int idx = 0; idx < N; ++idx) {
|
||||
Ort::Value map_out = seq_ort.GetValue(idx, default_allocator.get());
|
||||
for (size_t idx = 0; idx < N; ++idx) {
|
||||
Ort::Value map_out = seq_ort.GetValue(static_cast<int>(idx), default_allocator.get());
|
||||
|
||||
// fetch the map
|
||||
// first fetch the keys
|
||||
|
|
|
|||
Loading…
Reference in a new issue