From 9f343fa37f2424dfa397231b9b50c2e7ce27382c Mon Sep 17 00:00:00 2001 From: Pavel Durandin Date: Tue, 25 Jan 2022 15:10:34 +0300 Subject: [PATCH] Device memory fix for benchmark app (#9880) --- samples/cpp/benchmark_app/remote_tensors_filling.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/cpp/benchmark_app/remote_tensors_filling.cpp b/samples/cpp/benchmark_app/remote_tensors_filling.cpp index b8671ef3c22..0f2065c2979 100644 --- a/samples/cpp/benchmark_app/remote_tensors_filling.cpp +++ b/samples/cpp/benchmark_app/remote_tensors_filling.cpp @@ -89,9 +89,6 @@ std::map get_remote_input_tensors( << std::string((input.second.is_image() ? "image" : "some binary data")) << " is expected)" << slog::endl; - auto tensor = oclContext.create_tensor(input.second.type, input.second.dataShape, clBuffer.back().get()); - remoteTensors[input.first].push_back(tensor); - // Creating and filling shared buffers cl_int err; auto elementsNum = std::accumulate(begin(input.second.dataShape), @@ -108,6 +105,10 @@ std::map get_remote_input_tensors( CL_MEM_READ_WRITE, 0, (cl::size_type)inputSize); + + auto tensor = oclContext.create_tensor(input.second.type, input.second.dataShape, clBuffer.back().get()); + remoteTensors[input.first].push_back(tensor); + if (inputFiles.empty()) { // Filling in random data fill_buffer(mappedPtr, elementsNum, input.second.type);