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

[SYCL] Call to 'printArgs' is ambiguous #1011

Closed
j-stephan opened this issue Jan 15, 2020 · 2 comments · Fixed by #1062
Closed

[SYCL] Call to 'printArgs' is ambiguous #1011

j-stephan opened this issue Jan 15, 2020 · 2 comments · Fixed by #1062
Assignees
Labels
bug Something isn't working

Comments

@j-stephan
Copy link
Contributor

I am currently trying to implement a SYCL backend for a third-party application. In this application's source code (which I can't change) there is a function called printArgs. Unfortunately, this breaks the compilation since there is another printArgs inside the SYCL implementation:

/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, unsigned long, _pi_platform **, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:63:29: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24, cl::sycl::runtime_error>::operator()<_pi_device *, _pi_device_info, unsigned long, _pi_platform **, nullptr_t>' requested here
    PI_CALL(piDeviceGetInfo)(dev, pi::cast<RT::PiDeviceInfo>(param),
                            ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:298:71: note: in instantiation of member function 'cl::sycl::detail::get_device_info<cl::sycl::platform, cl::sycl::info::device::platform>::get' requested here
    platform plt = get_device_info<platform, info::device::platform>::get(dev);
                                                                      ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, unsigned long, _pi_platform **, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/workspace/third/party/application/kernel/../Config.hpp:198:6: note: candidate function [with TFirst = _pi_device *, TArgs = <_pi_device_info, unsigned long, _pi_platform **, nullptr_t>]
void printArgs(TFirst first, TArgs... args)
     ^

IMHO this shouldn't break so easily since the syntax printArgs(Arg0, Args...) is probably quite common.

@bader bader added the bug Something isn't working label Jan 15, 2020
@smaslov-intel
Copy link
Contributor

The SYCL's printArgs and the call to it are inside nested namespace:
https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/detail/pi.hpp

__SYCL_INLINE namespace cl {
namespace sycl {
namespace detail {
namespace pi {

Even if the top-level "cl" is inlined, I don't see how this could possible clash with the user's printArgs unless they happen to define it also in the [cl]::sycl::detail::pi namespace, which would be weird.

@j-stephan, can you give a reproducer, please?

@j-stephan
Copy link
Contributor Author

Sorry for the delay. Here is a reproducer:

#include <iostream>
    
template <typename TArg0, typename... TArgs>
auto printArgs(TArg0 arg, TArgs... args)
{
    std::cout << 42 << std::endl;
}

#include <CL/sycl.hpp>

int main()
{
    return 0;
}

Command line:

clang++ -std=c++17 -fsycl -O3 printArgs.cpp -lOpenCL

Full error log:

In file included from printArgs.cpp:9:
In file included from /home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl.hpp:11:
In file included from /home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/accessor.hpp:12:
In file included from /home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/atomic.hpp:13:
In file included from /home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/helpers.hpp:15:
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_platform *, _pi_platform_info, unsigned long, void *, unsigned long *), 8>::operator()<_pi_platform *, _pi_platform_info, int, nullptr_t, unsigned long *>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/platform_info.hpp:27:31: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_platform *, _pi_platform_info, unsigned long, void *, unsigned long *), 8, cl::sycl::runtime_error>::operator()<_pi_platform *, _pi_platform_info, int, nullptr_t, unsigned long *>' requested here
    PI_CALL(piPlatformGetInfo)(plt, pi::cast<pi_platform_info>(param), 0,
                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/platform_info.hpp:45:70: note: in instantiation of member function 'cl::sycl::detail::get_platform_info<std::__cxx11::basic_string<char>, cl::sycl::info::platform::extensions>::get' requested here
        get_platform_info<string_class, info::platform::extensions>::get(plt);
                                                                     ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_platform *, TArgs = <_pi_platform_info, int, nullptr_t, unsigned long *>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_platform *, Args = <_pi_platform_info, int, nullptr_t, unsigned long *>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_platform *, _pi_platform_info, unsigned long, void *, unsigned long *), 8>::operator()<_pi_platform *, _pi_platform_info, unsigned long, char *, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/platform_info.hpp:34:31: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_platform *, _pi_platform_info, unsigned long, void *, unsigned long *), 8, cl::sycl::runtime_error>::operator()<_pi_platform *, _pi_platform_info, unsigned long, char *, nullptr_t>' requested here
    PI_CALL(piPlatformGetInfo)(plt, pi::cast<pi_platform_info>(param),
                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/platform_info.hpp:45:70: note: in instantiation of member function 'cl::sycl::detail::get_platform_info<std::__cxx11::basic_string<char>, cl::sycl::info::platform::extensions>::get' requested here
        get_platform_info<string_class, info::platform::extensions>::get(plt);
                                                                     ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_platform *, TArgs = <_pi_platform_info, unsigned long, char *, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_platform *, Args = <_pi_platform_info, unsigned long, char *, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, unsigned long, unsigned long *, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:126:29: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24, cl::sycl::runtime_error>::operator()<_pi_device *, _pi_device_info, unsigned long, unsigned long *, nullptr_t>' requested here
    PI_CALL(piDeviceGetInfo)(
                            ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_device *, TArgs = <_pi_device_info, unsigned long, unsigned long *, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, unsigned long, unsigned long *, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, unsigned long, char *, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:80:29: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24, cl::sycl::runtime_error>::operator()<_pi_device *, _pi_device_info, unsigned long, char *, nullptr_t>' requested here
    PI_CALL(piDeviceGetInfo)(dev, pi::cast<RT::PiDeviceInfo>(param), resultSize,
                            ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:163:72: note: in instantiation of member function 'cl::sycl::detail::get_device_info<std::__cxx11::basic_string<char>, cl::sycl::info::device::built_in_kernels>::get' requested here
        get_device_info<string_class, info::device::built_in_kernels>::get(dev);
                                                                       ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_device *, TArgs = <_pi_device_info, unsigned long, char *, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, unsigned long, char *, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, int, nullptr_t, unsigned long *>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:187:29: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24, cl::sycl::runtime_error>::operator()<_pi_device *, _pi_device_info, int, nullptr_t, unsigned long *>' requested here
    PI_CALL(piDeviceGetInfo)(dev, info_partition, 0, nullptr, &resultSize);
                            ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_device *, TArgs = <_pi_device_info, int, nullptr_t, unsigned long *>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, int, nullptr_t, unsigned long *>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, unsigned long, long *, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:195:29: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24, cl::sycl::runtime_error>::operator()<_pi_device *, _pi_device_info, unsigned long, long *, nullptr_t>' requested here
    PI_CALL(piDeviceGetInfo)(dev, info_partition, resultSize, arrayResult.get(),
                            ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_device *, TArgs = <_pi_device_info, unsigned long, long *, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, unsigned long, long *, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, unsigned long, _pi_platform **, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:63:29: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24, cl::sycl::runtime_error>::operator()<_pi_device *, _pi_device_info, unsigned long, _pi_platform **, nullptr_t>' requested here
    PI_CALL(piDeviceGetInfo)(dev, pi::cast<RT::PiDeviceInfo>(param),
                            ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:298:71: note: in instantiation of member function 'cl::sycl::detail::get_device_info<cl::sycl::platform, cl::sycl::info::device::platform>::get' requested here
    platform plt = get_device_info<platform, info::device::platform>::get(dev);
                                                                      ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_device *, TArgs = <_pi_device_info, unsigned long, _pi_platform **, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, unsigned long, _pi_platform **, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/device_info.hpp:336:53: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_device *, _pi_device_info, unsigned long, void *, unsigned long *), 24>::operator()<_pi_device *, _pi_device_info, unsigned long, _pi_usm_capabilities *, nullptr_t>' requested here
    pi_result Err = PI_CALL_NOCHECK(piDeviceGetInfo)(
                                                    ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_device *, TArgs = <_pi_device_info, unsigned long, _pi_usm_capabilities *, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_device *, Args = <_pi_device_info, unsigned long, _pi_usm_capabilities *, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_kernel *), 320>::operator()<_pi_kernel *>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/kernel_impl.hpp:79:28: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_kernel *), 320, cl::sycl::runtime_error>::operator()<_pi_kernel *>' requested here
    PI_CALL(piKernelRetain)(MKernel);
                           ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_kernel *, TArgs = <>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_kernel *, Args = <>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_queue *, _pi_queue_info, unsigned long, void *, unsigned long *), 112>::operator()<_pi_queue *, _pi_queue_info, unsigned long, _pi_device **, nullptr_t>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/queue_impl.hpp:64:28: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_queue *, _pi_queue_info, unsigned long, void *, unsigned long *), 112, cl::sycl::runtime_error>::operator()<_pi_queue *, _pi_queue_info, unsigned long, _pi_device **, nullptr_t>' requested here
    PI_CALL(piQueueGetInfo)(m_CommandQueue, PI_QUEUE_INFO_DEVICE,
                           ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_queue *, TArgs = <_pi_queue_info, unsigned long, _pi_device **, nullptr_t>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_queue *, Args = <_pi_queue_info, unsigned long, _pi_device **, nullptr_t>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_queue *), 128>::operator()<_pi_queue *>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/queue_impl.hpp:69:27: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_queue *), 128, cl::sycl::runtime_error>::operator()<_pi_queue *>' requested here
    PI_CALL(piQueueRetain)(m_CommandQueue);
                          ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_queue *, TArgs = <>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_queue *, Args = <>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_queue *), 136>::operator()<_pi_queue *>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/queue_impl.hpp:75:30: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_queue *), 136, cl::sycl::runtime_error>::operator()<_pi_queue *>' requested here
      PI_CALL(piQueueRelease)(m_CommandQueue);
                             ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_queue *, TArgs = <>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_queue *, Args = <>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/queue_impl.hpp:163:39: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_context *, _pi_device *, unsigned long, _pi_queue **), 104>::operator()<_pi_context *, _pi_device *, unsigned long, _pi_queue **>' requested here
        PI_CALL_NOCHECK(piQueueCreate)(Context, Device, CreationFlags, &Queue);
                                      ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_context *, TArgs = <_pi_device *, unsigned long, _pi_queue **>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_context *, Args = <_pi_device *, unsigned long, _pi_queue **>]
void printArgs(Arg0 arg0, Args... args) {
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:150:7: error: call to 'printArgs' is ambiguous
      printArgs(args...);
      ^~~~~~~~~
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:183:47: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPi<_pi_result (*)(_pi_queue *), 120>::operator()<_pi_queue *>' requested here
    PiResult Err = (CallPi<FnType, FnOffset>::operator()(args...));
                                              ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/queue_impl.hpp:195:27: note: in instantiation of function template specialization 'cl::sycl::detail::pi::CallPiAndCheck<_pi_result (*)(_pi_queue *), 120, cl::sycl::runtime_error>::operator()<_pi_queue *>' requested here
    PI_CALL(piQueueFinish)(m_Queues[FreeQueueNum]);
                          ^
printArgs.cpp:4:6: note: candidate function [with TArg0 = _pi_queue *, TArgs = <>]
auto printArgs(TArg0 arg, TArgs... args)
     ^
/home/jan/software/sycl/intel/lib/clang/10.0.0/include/CL/sycl/detail/pi.hpp:114:6: note: candidate function [with Arg0 = _pi_queue *, Args = <>]
void printArgs(Arg0 arg0, Args... args) {
     ^
14 errors generated.

Tested with an up-to-date compiler (commit 97a199f).

@j-stephan j-stephan changed the title [SYCL] Call to 'printArgs' is ambigous [SYCL] Call to 'printArgs' is ambiguous Jan 21, 2020
smaslov-intel added a commit to smaslov-intel/llvm that referenced this issue Mar 22, 2020
Signed-off-by: Sergey V Maslov <sergey.v.maslov@intel.com>
aelovikov-intel pushed a commit that referenced this issue Feb 17, 2023
The commands for clang-offload-bundler have been updated to use -output
instead of -outputs.  Update test.cpp which uses clang-offload-bundler
directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants