8000 Discrepancies with provisional SYCL2020 specs? · Issue #2971 · intel/llvm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Discrepancies with provisional SYCL2020 specs? #2971

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.

Sign up for GitHub

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

Closed
al42and opened this issue Dec 30, 2020 · 6 comments
Closed

Discrepancies with provisional SYCL2020 specs? #2971

al42and opened this issue Dec 30, 2020 · 6 comments
Assignees

Comments

@al42and
Copy link
Contributor
al42and commented Dec 30, 2020

Hello!

Given that the -sycl-std=2020 switch is allowed and SYCL_LANGUAGE_VERSION is set to 202001, one would expect that the provisional specs are supported.

I wasn't able to find details about any limitations related to the support for the SYCL 2020 standard in the current version of the compiler. Please, point me to such a document if it exists.

However, the following program, seemingly compliant with the specs, fails to compile with the latest sycl branch (f58c568).

#include <iostream>

// Section 4.3 Header files and namespaces
#include <SYCL/sycl.hpp>

auto myKernel(cl::sycl::handler& cgh)
{
    sycl::stream debug(10240, 128, cgh);
   
    return [=](cl::sycl::nd_item<1> itemIdx) {
        if (itemIdx.get_global_linear_id() == 0) {
            // Section 4.10.1.8 sub_group class
            sycl::sub_group sg = itemIdx.get_sub_group();
            float f = 0;
            // Section 4.19.5.4 group_reduce
            f = sycl::group_reduce(sg, f, sycl::plus<float>{});
            debug << "    Sub_group range: " << sg.get_local_range()[0] << cl::sycl::endl;
        }
    };
}

constexpr int numBlocks = 8;
constexpr int blockSize = 16;

int main()
{
    cl::sycl::device dev(cl::sycl::gpu_selector{});
    cl::sycl::queue q{dev};

    std::cout << "Running 1D kernel" << std::endl;
    const cl::sycl::nd_range<1> range1D{ { numBlocks * blockSize }, { blockSize } };
    q.submit([&](cl::sycl::handler& cgh) {
            auto kernel = myKernel(cgh);
            // Section 4.14.2 Defining kernels as lambda functions
            cgh.parallel_for(range1D, kernel);
            }).wait_and_throw();
    std::cout << "    Done" << std::endl;
    return 0;
}

Compilation options: clang++ -fsycl -sycl-std=2020 ./sycl_2020.cpp -o sycl_2020.

References to specific parts of SYCL2020 provisional specs that are apparently missing:

  • Section 4.3: The include should be SYCL/sycl.hpp, but only CL/sycl.hpp is available.
  • Section 4.14.2: Providing a name for lambda-kernel must be optional, but requires -fsycl-unnamed-lambda to work.
  • Section 4.10.1.8: There should be sycl::sub_group class, but only sycl::ONEAPI::sub_group is available.
  • Section 4.19.5.4: There should be sycl::group_reduce function, but only sycl::ONEAPI::reduce is available.
  • Section 4.19.3: There should be sycl::plus functor, but only sycl::ONEAPI::plus is available.
@pvchupin
Copy link
Contributor

Thanks for issue and list of items noticed as missing. Work is in progress for SYCL2020. We should update our documentation to set clear expectations. I'll update docs and we'll keep this issue open until items mentioned here are done.

@al42and
Copy link
Contributor Author
al42and commented Jan 15, 2021

@pvchupin Thanks for the heads up.

Not sure if this issue is worth keeping open after the docs are updated. It's not a comprehensive list of all things missing. E.g., there's also sycl::group_any_of, sycl::memory_order, sycl::memory_scope, sycl::atomic_ref that are part of SYCL2020, but are currently only available in sycl::ONEAPI namespace. Probably others -- these are the ones I personally encountered.

A dedicated meta-issue for proper tracking of missing features might be a better idea? And it would also work as the live documentation about the current state of the SYCL2020 support.

@keryell
Copy link
Contributor
keryell commented Jan 15, 2021

This issue will need some update anyway once the final specification is published but it is probably useful to keep it open to be sure we do not miss at least these points if they still exists in respect to the final spec.

@pvchupin
Copy link
Contributor

Right, it's clear that list mentioned here is not complete. We track many other items internally. I think it is a good idea indeed to produce a more detailed list on what's not supported yet for SYCL2020. I think as soon as final spec is published we can build one.

pvchupin pushed a commit to pvchupin/llvm that referenced this issue Jan 18, 2021
* Add note that SYCL 2020 implementation is in progress (see issue intel#2971)
* Add note that DPC++ runtime and headers require C++14 (see PR intel#2528)

Signed-off-by: Pavel V Chupin <pavel.v.chupin@intel.com>
pvchupin added a commit that referenced this issue Jan 19, 2021
* Add note that SYCL 2020 implementation is in progress (see issue #2971)
* Add note that DPC++ runtime and headers require C++14 (see PR #2528)

Signed-off-by: Pavel V Chupin <pavel.v.chupin@intel.com>
@al42and
Copy link
Contributor Author
al42and commented Feb 18, 2021

Updated references to the final SYCL 2020 specs:

  • Section 4.3: The include should be sycl/sycl.hpp, but only CL/sycl.hpp is available.
  • Section 4.9.4.2: Providing a name for lambda-kernel must be optional, but requires -fsycl-unnamed-lambda to work.
  • Section 4.9.1.8: There should be sycl::sub_group class, but only sycl::ONEAPI::sub_group is available.
  • Section 4.17.4.5: There should be sycl::reduce_over_group function, but only sycl::ONEAPI::reduce is available.
  • Section 4.17.2: There should be sycl::plus functor, but only sycl::ONEAPI::plus is available.

@al42and
Copy link
Contributor Author
al42and commented Jan 26, 2022

Most of the issues listed here have been resolved, so I see no point in keeping this issue open anymore.

@al42and al42and closed this as completed Jan 26, 2022
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

3 participants
0