Device memory fix for benchmark app (#9880)

This commit is contained in:
Pavel Durandin 2022-01-25 15:10:34 +03:00 committed by GitHub
parent fa605a2760
commit 9f343fa37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,9 +89,6 @@ std::map<std::string, ov::TensorVector> get_remote_input_tensors(
<< std::string((input.second.is_image() ? "image" : "some binary data")) << " is expected)" << std::string((input.second.is_image() ? "image" : "some binary data")) << " is expected)"
<< slog::endl; << 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 // Creating and filling shared buffers
cl_int err; cl_int err;
auto elementsNum = std::accumulate(begin(input.second.dataShape), auto elementsNum = std::accumulate(begin(input.second.dataShape),
@ -108,6 +105,10 @@ std::map<std::string, ov::TensorVector> get_remote_input_tensors(
CL_MEM_READ_WRITE, CL_MEM_READ_WRITE,
0, 0,
(cl::size_type)inputSize); (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()) { if (inputFiles.empty()) {
// Filling in random data // Filling in random data
fill_buffer(mappedPtr, elementsNum, input.second.type); fill_buffer(mappedPtr, elementsNum, input.second.type);