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

Cannot distinguish between host/device warnings and errors #1254

Closed
Pennycook opened this issue Mar 5, 2020 · 4 comments
Closed

Cannot distinguish between host/device warnings and errors #1254

Pennycook opened this issue Mar 5, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Pennycook
Copy link
Contributor

I'm not sure if this issue is specific to kernel attributes or has wider applicability, but it can be difficult to understand whether host or device compilation is producing a given warning or error.

I'm most concerned about cases when only one of the compilers produces a warning, as below:

#include <CL/sycl.hpp>
using namespace sycl;

int main(int argc, char* argv[])
{
    queue q;
    q.submit([&](handler& cgh)
    {
        cgh.single_task<class test>([]() [[cl::intel_reqd_sub_group_size(8)]]
        {
        });
    });
}
reqd_sub_group_size.cpp:9:44: warning: 'intel_reqd_sub_group_size' attribute ignored [-Wignored-attributes]
        cgh.single_task<class test>([]() [[cl::intel_reqd_sub_group_size(8)]]
                                           ^
1 warning generated.

It is not clear from this message that the attribute was ignored on the host but respected on the device (or that this is expected behavior). Is there any way we could make this more obvious, like inserting the words "host" and "device" into the compilation output somewhere?

@Pennycook Pennycook added the enhancement New feature or request label Mar 5, 2020
@keryell
Copy link
Contributor

keryell commented Mar 7, 2020

This is another argument for not using attributes directly but use C++ DSL constructions instead that can switch the the hidden attributes on/off behind the scene according to the context and also emit error messages at the library level instead of adding more and more cognitive load in the compiler...

@keryell
Copy link
Contributor

keryell commented Mar 7, 2020

A good example of a DSL approach seems https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/IntelFPGA/FPGAReg.md

@Pennycook
Copy link
Contributor Author

I don't disagree, but I'm worried that hiding implementation details like this may still produce cases where the host and device compiler passes see different code and produce different warnings/errors.

I'll give some more thought to the reqd_sub_group_size attribute and what it would take to implement it at the library level. We'd need a solution that could modify the type of a functor, a lambda or a device function in an external translation unit.

@keryell
Copy link
Contributor

keryell commented Mar 9, 2020

Well, it is obviously up to the library implementer to come with the correct implementation and the righ error messages. :-)
For your last sentence, I made already some presentations inside the SYCL committee around 2016 and we discussed this again during last F2F meeting.
I summarized this in https://gitlab.khronos.org/sycl/Specification/issues/296

victor-eds added a commit that referenced this issue Feb 2, 2024
`KernelFusion/Reduction/reduction.cpp` was `XFAIL`ed in #1254 to avoid
CI errors. This patch fixes that error by assigning auxiliary
resources from each fused command group to the placeholder fusion
event.

This event will not be marked as completed after the fused reductions
finish execution either if fusion is completed , cancelled or aborted.

Test is updated to check every algorithm. This way we cover both
cases (fusion taking and not taking place), as some algorithms will
fail to fuse due to the nature of the command groups being
launched (incompatible ND-ranges or incompatible command-group kinds).

Signed-off-by: Victor Perez <victor.perez@codeplay.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants