Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions unified-runtime/source/adapters/level_zero/v2/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,18 @@ void ur_shared_buffer_handle_t::unmapHostPtr(
// nop
}

static bool useHostBuffer(ur_context_handle_t /* hContext */) {
static bool useHostBuffer(ur_context_handle_t hContext) {
// We treat integrated devices (physical memory shared with the CPU)
// differently from discrete devices (those with distinct memories).
// For integrated devices, allocating the buffer in the host memory
// enables automatic access from the device, and makes copying
// unnecessary in the map/unmap operations. This improves performance.

// TODO: fix integrated buffer implementation
return false;

// return hContext->getDevices().size() == 1 &&
// hContext->getDevices()[0]->ZeDeviceProperties->flags &
// ZE_DEVICE_PROPERTY_FLAG_INTEGRATED;
return hContext->getDevices().size() == 1 &&
hContext->getDevices()[0]->ZeDeviceProperties->flags &
ZE_DEVICE_PROPERTY_FLAG_INTEGRATED;
}

ur_mem_sub_buffer_t::ur_mem_sub_buffer_t(ur_mem_handle_t hParent, size_t offset,
Expand Down
Loading