mesa merge requestshttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests2020-10-29T10:18:08Zhttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5891Add work ID system values needed for OpenCL2020-10-29T10:18:08ZJesse Nataliejenatali@microsoft.comAdd work ID system values needed for OpenCLOpenCL supports the concept of a global work ID offset at the API. This offset needs to be seen in two places:
1. Explicit calls to `get_global_offset` builtins, which map to `SpvBuiltInGlobalOffset`.
2. Calls to `get_global_id` or `get_...OpenCL supports the concept of a global work ID offset at the API. This offset needs to be seen in two places:
1. Explicit calls to `get_global_offset` builtins, which map to `SpvBuiltInGlobalOffset`.
2. Calls to `get_global_id` or `get_global_linear_id`.
To support this, I added two new system values:
1. Global offset (base_global_invocation_id)
2. Global ID without offset (global_invocation_id_zero_base)
If the driver/API doesn't call the new nir pass with the option which indicates that one of these offsets is present, then the driver continues to see the existing sysval intrinsics. If they do run this pass with the option, then the existing sysvals get lowered into the new ones. Furthermore, the D3D12 backend would prefer to keep the global ID all the way to the backend, so an option is added for that - but if that's not set then it gets lowered even further.
Something that's not explicit in the OpenCL kernel, but implicit through the API requirements, is that the driver may need to loop invocations, if the number of requested threads exceeds what can be done natively in hardware. To support this, the concept of work group ID offsets is also added. This allows looped dispatches to have different work group ID values, which can create the appearance of a single dispatch across the entire thread space. These are lowered similarly to the global ID offsets.
/cc @karolherbst @jekstrandnir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242OpenCL nir/vtn: Support images/samplers from kernel SPIR-V to nir2020-09-03T17:49:19ZJesse Nataliejenatali@microsoft.comOpenCL nir/vtn: Support images/samplers from kernel SPIR-V to nirThis series is several commits from our in-progress D3D12/DXIL backend. We've been able to use the resulting NIR to generate DXIL that can run real-world kernels that use images, including the full OpenCL 1.2 CTS.
High-level, the series...This series is several commits from our in-progress D3D12/DXIL backend. We've been able to use the resulting NIR to generate DXIL that can run real-world kernels that use images, including the full OpenCL 1.2 CTS.
High-level, the series deals with:
1. OpenCL images are untyped (void return), while loads/stores are typed. This adds untyped images to the GLSL type system, and adds type information to the deref load/store intrinsics. Note that if the CL code called the `read_image` function and passed a sampler, this ends up constructing a `SampledImage` and therefore converting the instruction to a `tex` op, rather than a read/write intrinsic. That means that backends will need to deal with tex ops pointing to *images* rather than samplers.
2. There's already some logic in vtn for dealing with passing images/samplers/sampled images through functions, but some minor tweaks were needed to deal with the fact that the kernel entrypoint wrapper wants to use `input` variables, and how it ends up passing parameters. My strong preference here is to keep the variables as `input`, since it enables us to match variables to kernel argument metadata more easily.
3. It adds some new intrinsics to deal with CL-specific format queries. It also handles `ImageSizeLod` being generated for size queries against CL images.
4. Literal samplers (`OpConstantSampler`) need to be handled. This series generates `uniform` variables with the sampler properties stored in the variable's data.
It's based on !6396.
/cc @karolherbst @jekstrandnir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4580nvc0: support SVM on gp100+ through HMM2020-07-29T23:38:21ZKarol Herbstkherbst@redhat.comnvc0: support SVM on gp100+ through HMMnir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4323WIP: CL: use libclc spirv2020-08-18T11:24:55ZDave AirlieWIP: CL: use libclc spirvThis add support for loading a spir-v library generated from libclc to implement a set of the CL runtime functions.
It requires a set of clc patches
https://gitlab.freedesktop.org/airlied/libclc
It requires switch support and the stru...This add support for loading a spir-v library generated from libclc to implement a set of the CL runtime functions.
It requires a set of clc patches
https://gitlab.freedesktop.org/airlied/libclc
It requires switch support and the structurizer to be merged
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401nir based OpenCLhttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4072gallium: make handles of set_global_binding 64 bit2020-03-11T07:38:26ZKarol Herbstkherbst@redhat.comgallium: make handles of set_global_binding 64 bitneeded by CLneeded by CLnir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4068nir/deref: copy ptr_stride when rematerializing2020-05-22T15:58:16ZKarol Herbstkherbst@redhat.comnir/deref: copy ptr_stride when rematerializingnir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401unstructured NIR2020-09-28T16:23:37ZKarol Herbstkherbst@redhat.comunstructured NIRThis is some WIP branch where I try to consume unstructured spir-v and lower it to nir_ifs and nir_loops where easily convertible.
At this point I am fighting quite a lot against nirs control flow manipulation functions and maybe somebo...This is some WIP branch where I try to consume unstructured spir-v and lower it to nir_ifs and nir_loops where easily convertible.
At this point I am fighting quite a lot against nirs control flow manipulation functions and maybe somebody of you have some hints or suggestions on how to improve this.
I think this current versions only really supports if clauses and maybe I find a proper way to complete it soon.nir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2370clover: add trivial clCreateCommandQueueWithProperties implementation2020-02-04T18:31:51ZKarol Herbstkherbst@redhat.comclover: add trivial clCreateCommandQueueWithProperties implementationIt's not adding 2.0 features, but it's enough to run the 2.0 CTS on top of
clover and probably most CL applications using it.
We just fail if we hit unknown properties and that's probably good enough
until we implement the other bits pr...It's not adding 2.0 features, but it's enough to run the 2.0 CTS on top of
clover and probably most CL applications using it.
We just fail if we hit unknown properties and that's probably good enough
until we implement the other bits properly.
Signed-off-by: Karol Herbst <kherbst@redhat.com>nir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2078clover: support IL programs2021-01-01T23:21:49ZPierre Moreauclover: support IL programsThe extension cl_khr_il_program and OpenCL 2.1 added functionalities to provide kernels as intermediate languages rather than OpenCL C. This merge request adds the infrastructure for it, as well as support for the extension and the extra...The extension cl_khr_il_program and OpenCL 2.1 added functionalities to provide kernels as intermediate languages rather than OpenCL C. This merge request adds the infrastructure for it, as well as support for the extension and the extra OpenCL 2.1 functions.nir based OpenCLMarge BotMarge Bothttps://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076Add SVM support to Clover2020-04-15T11:34:51ZKarol Herbstkherbst@redhat.comAdd SVM support to Clovernir based OpenCLMarge BotMarge Bot