Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on support for -cl-std=CL2.0 #769

Open
hooneecho opened this issue Mar 4, 2025 · 0 comments
Open

Question on support for -cl-std=CL2.0 #769

hooneecho opened this issue Mar 4, 2025 · 0 comments

Comments

@hooneecho
Copy link

hooneecho commented Mar 4, 2025

I'd like to know if CLVK latest fully support "-cl-std=CL2.0" or not.

The reason why I ask here is that
the return value of CL_DEVICE_OPENCL_C_ALL_VERSIONS is like below, which doesn't have 2.0.0.

    // Build list of supported OpenCL C versions
    m_opencl_c_versions = {
        MAKE_NAME_VERSION(1, 0, 0, "OpenCL C"),
        MAKE_NAME_VERSION(1, 1, 0, "OpenCL C"),
        MAKE_NAME_VERSION(1, 2, 0, "OpenCL C"),
        MAKE_NAME_VERSION(3, 0, 0, "OpenCL C"),
    };

https://github.com/kpet/clvk/blob/main/src/device.cpp#L767

BTW, given the subsitution vector below,
It seems to work assuming that it can receive "-cl-std=CL2.0" as a compile option from the driver user/client.

    std::vector<std::pair<std::string, std::string>> option_substitutions = {
        // FIXME The 1.2 conformance tests shouldn't pass this option.
        //       It doesn't exist after OpenCL 1.0.
        {"-cl-strict-aliasing", ""},
        // clspv require entrypoint inlining for OpenCL 2.0 and OpenCL 3.0 (for
        // generic addrspace for example).
        {"-cl-std=CL2.0", "-cl-std=CL2.0 -inline-entry-points"},
        {"-cl-std=CL3.0", "-cl-std=CL3.0 -inline-entry-points"},
        {"-create-library", ""},
    };

https://github.com/kpet/clvk/blob/main/src/program.cpp#L925

Plus, Its compiler stack(CLSPV) is also supporting "-cl-std=CL2.0" AFAIK, so I believe It is enough to add 2.0 to m_opencl_c_versions.

Please correct me if I'm misunderstood or wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant