Fix two prefast warnings (#13211)

This commit is contained in:
Ashwini Khade 2022-10-03 20:00:57 -07:00 committed by GitHub
parent 962fee5fe5
commit c780c4a2b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -64,7 +64,7 @@ common::Status TrainingAgent::RunForward(const std::vector<OrtValue>& feeds, std
state.SetProgramCounterStart(0);
state.SetProgramCounterEnd(fw_program_counter_end_);
const int32_t partial_graph_index = 0;
constexpr int32_t partial_graph_index = 0;
return RunCore(feeds, fetches, state, *fw_feeds_fetches_manager_, cache, partial_graph_index);
}
@ -72,7 +72,7 @@ common::Status TrainingAgent::RunBackward(const std::vector<OrtValue>& feeds, st
PartialGraphExecutionState& state) {
state.SetProgramCounterStart(fw_program_counter_end_);
state.SetProgramCounterEnd(bw_program_counter_end_);
const int32_t partial_graph_index = 1;
constexpr int32_t partial_graph_index = 1;
return RunCore(feeds, fetches, state, *bw_feeds_fetches_manager_, nullptr, partial_graph_index);
}

View file

@ -147,7 +147,7 @@ Status SoftmaxCrossEntropyLoss<T, Tin>::ComputeInternal(OpKernelContext* ctx) co
reduction_buffer.get(),
buffer_size));
} else {
const TBuf normalize_factor = static_cast<TBuf>(1.0f);
constexpr TBuf normalize_factor = static_cast<TBuf>(1.0f);
CUDA_RETURN_IF_ERROR(cudaMemcpyAsync(normalize_factor_data.get(), &normalize_factor, sizeof(TBuf), cudaMemcpyHostToDevice, Stream()));
}