@@ -114,11 +114,16 @@ void *ur_integrated_buffer_handle_t::getDevicePtr(
114
114
void *ur_integrated_buffer_handle_t ::mapHostPtr(
115
115
ur_map_flags_t /* flags*/ , size_t offset, size_t /* size*/ ,
116
116
std::function<void (void *src, void *dst, size_t )> /* migrate*/ ) {
117
+ // TODO: if writeBackPtr is set, we should map to that pointer
118
+ // because that's what SYCL expects, SYCL will attempt to call free
119
+ // on the resulting pointer leading to double free with the current
120
+ // implementation. Investigate the SYCL implementation.
117
121
return ur_cast<char *>(ptr.get ()) + offset;
118
122
}
119
123
120
124
void ur_integrated_buffer_handle_t::unmapHostPtr (
121
125
void * /* pMappedPtr*/ , std::function<void (void *src, void *dst, size_t )>) {
126
+ // TODO: if writeBackPtr is set, we should copy the data back
122
127
/* nop */
123
128
}
124
129
@@ -371,15 +376,19 @@ void ur_shared_buffer_handle_t::unmapHostPtr(
371
376
// nop
372
377
}
373
378
374
- static bool useHostBuffer (ur_context_handle_t hContext) {
379
+ static bool useHostBuffer (ur_context_handle_t /* hContext */ ) {
375
380
// We treat integrated devices (physical memory shared with the CPU)
376
381
// differently from discrete devices (those with distinct memories).
377
382
// For integrated devices, allocating the buffer in the host memory
378
383
// enables automatic access from the device, and makes copying
379
384
// unnecessary in the map/unmap operations. This improves performance.
380
- return hContext->getDevices ().size () == 1 &&
381
- hContext->getDevices ()[0 ]->ZeDeviceProperties ->flags &
382
- ZE_DEVICE_PROPERTY_FLAG_INTEGRATED;
385
+
386
+ // TODO: fix integrated buffer implementation
387
+ return false ;
388
+
389
+ // return hContext->getDevices().size() == 1 &&
390
+ // hContext->getDevices()[0]->ZeDeviceProperties->flags &
391
+ // ZE_DEVICE_PROPERTY_FLAG_INTEGRATED;
383
392
}
384
393
385
394
ur_mem_sub_buffer_t ::ur_mem_sub_buffer_t (ur_mem_handle_t hParent, size_t offset,
0 commit comments