CHIP-SPV / chipStar

chipStar is a tool for compiling and running HIP/CUDA on SPIR-V via OpenCL or Level Zero APIs.
Other
219 stars 32 forks source link

OpenCL: Support devices with cl_ext_buffer_device_address #830

Closed linehill closed 4 months ago

linehill commented 5 months ago

Use cl_ext_buffer_device_address extension (experimental at the time of this commit) for managing HIP device allocations on devices where neither USM nor SVM is available. The latest main of POCL and, hopefully soon, Mesa's rusticl supports this extension. Briefly, the extension enables the OpenCL backend to pin cl_mem buffers to device memory and obtain their fixed addresses.

The extension has a down side that the addresses of the device and host allocations may alias, thus, we can't automatically determine copy direction in hipMemcpy*(, hipMemcpyDefault) calls. For this reason the unified [virtual] addressing feature is set off and, consequently, hipMemcpyDefault is unsupported and allocations from hipHostMalloc() are not implicitly mapped and portable. Also, hipHostMalloc(..., hipHostMallocMapped) calls are not supported yet (unimplemented).

Other changes:

linehill commented 5 months ago

Switched to draft mode: need to reflect changes in https://github.com/pocl/pocl/pull/1449.

pvelesko commented 4 months ago

conflicts