!33723 [MSLITE][GPU] benchmark code clean

Merge pull request !33723 from Greatpan/benchmark_fix
This commit is contained in:
i-robot 2022-04-29 06:10:19 +00:00 committed by Gitee
commit 57330a63c1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 1 deletions

View File

@ -133,6 +133,9 @@ int Benchmark::GenerateGLTexture(std::map<std::string, GLuint> *input_gl_texture
int Benchmark::FillGLTextureToTensor(std::map<std::string, GLuint> *gl_texture, mindspore::tensor::MSTensor *tensor,
std::string name, void *data) {
MS_ASSERT(gl_texture != nullptr);
MS_ASSERT(tensor != nullptr);
auto image_id = 0;
int width = 1, height = 1, channel = 1;
@ -228,7 +231,6 @@ int Benchmark::ReadGLTextureFile(std::map<std::string, GLuint> *input_gl_texture
}
}
for (const auto &output : ms_outputs_) {
MS_ASSERT(tensor != nullptr);
auto status = FillGLTextureToTensor(output_gl_texture, output.second, output.first);
if (status != RET_OK) {
MS_LOG(ERROR) << "Fill GLTexture to output tensor" << status;

View File

@ -81,6 +81,9 @@ int BenchmarkUnifiedApi::GenerateGLTexture(std::map<std::string, GLuint> *input_
int BenchmarkUnifiedApi::FillGLTextureToTensor(std::map<std::string, GLuint> *gl_texture, mindspore::MSTensor *tensor,
std::string name, void *data) {
MS_ASSERT(gl_texture != nullptr);
MS_ASSERT(tensor != nullptr);
auto image_id = 0;
int width = 1, height = 1, channel = 1;