CHIP-SPV / chipStar

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

OpenCL: Skip SVM pointer annotation if possible #785

Closed linehill closed 3 months ago

linehill commented 4 months ago

Calling clSetKernelExecInfo() for passing CL_KERNEL_EXEC_INFO_SVM_PTRS demonstrates notable overhead on PVC. For example, HeCBench/hybridsort-hip sees 4-16% slowdown.

This patch adds a rudimentary analysis for detecting whether device modules might have indirect buffer accesses. The OpenCL backend skips clSetKernelExecInfo() calls when it knows the module, the kernel belongs to, does not have any indirect accesses.

pvelesko commented 4 months ago

I see some failures that seem unrelated to this PR, let me investigate.

linehill commented 4 months ago

Rebased now.

pvelesko commented 4 months ago

Only this is failing now

dgpu_opencl_make_check_result.txt: FAIL
    358 - Unit_hipClassKernel_Friend (SEGFAULT)

This is fixed in #791 so let's merge that first

pvelesko commented 4 months ago

conflits

linehill commented 4 months ago

Rebased. Should have compiler error resolved seen in the CI in the merge prior this rebase.