apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.82k stars 3.48k forks source link

[OPENCL][ADRENO] Introduce Qualcomm extension support #17519

Closed srkreddy1238 closed 1 week ago

srkreddy1238 commented 2 weeks ago

"cl_qcom_perf_hint", "cl_qcom_priority_hint" extn support added over workspace interface.

OpenCL version will be picked up from SDK headers. CI fixes for build without Adreno OpenCL SDK. Extensions are activated based on its availability in SDK.

New workspace API "SetNativePtr" defined that releases existing cl_mem and creates new mem object backed by given host ptr.

Works for cl_qcom_ion_host_ptr, cl_qcom_android_ahardwarebuffer_host_ptr, cl_qcom_android_native_buffer_host_ptr, cl_qcom_dmabuf_host_ptr and cl_qcom_ion_host_ptr.

The responsibility of preparing the host_ptr objects is with application.

Some times the application needs device id for various devices related information. Use below ref. to get cl_device_id from workspace.

OpenCLWorkspace* workspace = OpenCLWorkspace::Global(); cl_device_id device_id = workspace->GetCLDeviceID(0);