Skip to content

Commit

Permalink
Use correct form for properties
Browse files Browse the repository at this point in the history
  • Loading branch information
pereanub committed Oct 4, 2024
1 parent 76d58b7 commit cfc0a15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ZeroRemoteTensor : public RemoteTensor {
void* _mem = nullptr;
void* _data = nullptr;

bool _external_memory_support = true;
bool _external_memory_support = false;
};

} // namespace intel_npu
13 changes: 10 additions & 3 deletions src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ ZeroRemoteTensor::ZeroRemoteTensor(std::shared_ptr<ov::IRemoteContext> context,
ze_device_external_memory_properties_t desc = {};
desc.stype = ZE_STRUCTURE_TYPE_DEVICE_EXTERNAL_MEMORY_PROPERTIES;
auto res = zeDeviceGetExternalMemoryProperties(_init_structs->getDevice(), &desc);
if (res != ZE_RESULT_SUCCESS || (desc.memoryAllocationImportTypes != ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF &&
desc.memoryAllocationImportTypes != ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32)) {
_external_memory_support = false;
if (res == ZE_RESULT_SUCCESS) {
#ifdef _WIN32
if (desc.memoryAllocationImportTypes & ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32) {
_external_memory_support = true;
}
#else
if (desc.memoryAllocationImportTypes & ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF) {
_external_memory_support = true;
}
#endif
}

allocate(byte_size);
Expand Down

0 comments on commit cfc0a15

Please sign in to comment.