Skip to content

Cannot build CTS #3020

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

Closed
nyalloc opened this issue Jan 12, 2021 · 6 comments
Closed

Cannot build CTS #3020

nyalloc opened this issue Jan 12, 2021 · 6 comments
Labels

Comments

@nyalloc
Copy link
Contributor

nyalloc commented Jan 12, 2021

Trying to build the SYCL CTS fails to build when using the lastest Intel LLVM.

cmake -DSYCL_IMPLEMENTATION=Intel_SYCL -DINTEL_SYCL_ROOT=/home/stuart/2021/llvm/build ../
make

Results in numerous failures with the same complaint:

In file included from /home/stuart/2021/llvm/build/bin/../include/sycl/CL/sycl.hpp:16:
In file included from /home/stuart/2021/llvm/build/bin/../include/sycl/CL/sycl/ONEAPI/reduction.hpp:14:
/home/stuart/2021/llvm/build/bin/../include/sycl/CL/sycl/handler.hpp:819:9: error: no matching function for call to object of type 'const accessor_utility::buffer_accessor_api_r<int, 0, sycl::access::mode::read, sycl::access::target::global_buffer, sycl::access::target::global_buffer, sycl::access::placeholder::false_t>'
        KernelFunc(Arg);
        ^~~~~~~~~~
@bader
Copy link
Contributor

bader commented Jan 14, 2021

@nyalloc, unfortunately, I can't reproduce this problem.

/home/stuart/2021/llvm/build/bin/../include/sycl/CL/sycl/handler.hpp:819:9: error: no matching function for call to object of type 'const accessor_utility::buffer_accessor_api_r<int, 0, sycl::access::mode::read, sycl::access::target::global_buffer, sycl::access::target::global_buffer, sycl::access::placeholder::false_t>'
        KernelFunc(Arg);
        ^~~~~~~~~~

Line 819, doesn't look like this in the latest version of the source code. Could you check if your build directory is up-to-date, please?

@v-klochkov
Copy link
Contributor

I don't know if CTS that I am using is the latest one. It is reproducible for me.
Below is the reduced version of one of failed CTS tests:

#include <CL/sycl.hpp>

struct MyFunctor {
void operator()(cl::sycl::id<1> idx) {}
};

void run() {
cl::sycl::queue queue;
queue.submit([&](cl::sycl::handler &handler) {
handler.parallel_for(cl::sycl::range<1>{8}, MyFunctor());
});
}

clang++ -fsycl accessor_api_buffer.cpp

15:44:29 > clang++ -fsycl accessor_api_buffer.cpp
In file included from accessor_api_buffer.cpp:1:
In file included from /export/users/vklochko/ws/gs_public/llvm/build/install/bin/../include/sycl/CL/sycl.hpp:16:
In file included from /export/users/vklochko/ws/gs_public/llvm/build/install/bin/../include/sycl/CL/sycl/ONEAPI/reduction.hpp:15:
/export/users/vklochko/ws/gs_public/llvm/build/install/bin/../include/sycl/CL/sycl/handler.hpp:823:9: error: no matching function for call to object of type 'const MyFunctor'
KernelFunc(Arg);
^~~~~~~~~~
/export/users/vklochko/ws/gs_public/llvm/build/install/bin/../include/sycl/CL/sycl/handler.hpp:1035:5: note: in instantiation of function template specialization 'sycl::handler::parallel_for_lambda_impl<sycl::detail::auto_name, MyFunctor, 1>' requested here
parallel_for_lambda_impl(NumWorkItems, std::move(KernelFunc));
^
accessor_api_buffer.cpp:10:13: note: in instantiation of function template specialization 'sycl::handler::parallel_for<sycl::detail::auto_name, MyFunctor>' requested here
handler.parallel_for(cl::sycl::range<1>{8}, MyFunctor());
^
accessor_api_buffer.cpp:4:8: note: candidate function not viable: 'this' argument has type 'const MyFunctor', but method is not marked const
void operator()(cl::sycl::id<1> idx) {}
^
1 error generated.

Adding 'const' specifier to the MyFunctor::operator() fixes the problem.

@bader
Copy link
Contributor

bader commented Jan 21, 2021

@v-klochkov, you should build SYCL-CTS with -sycl-std=121 option ON.
If you are building source from https://github.com/KhronosGroup/SYCL-CTS/ repository, please, make sure that it contains this commit -
KhronosGroup/SYCL-CTS@856f9a2.

@v-klochkov
Copy link
Contributor

I forgot to write that, but with -sycl-std=121 the error is the same. A month or two ago -sycl-std=121 worked as a workaround for that issue, but not now. Probably, something got pulled to compiler

@v-klochkov
Copy link
Contributor

The problem is caused by the fix #2703

@github-actions
Copy link
Contributor

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days.

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

No branches or pull requests

3 participants