Skip to content

sycl::is_compatible is declared but not defined #5561

@al42and

Description

@al42and

Describe the bug

The following function is declared in sycl/include/CL/sycl/kernel_bundle.hpp but is does not seem to be defined anywhere:

bool is_compatible(const std::vector<kernel_id> &kernelIds, const device &dev);

To Reproduce

Check IntelLLVM repo:

$ git grep -C2 is_compatible 
mlir/lib/Bindings/Python/DialectQuant.cpp-      "The bitwidth of the storage type of this quantized type.");
mlir/lib/Bindings/Python/DialectQuant.cpp-  quantizedType.def(
mlir/lib/Bindings/Python/DialectQuant.cpp:      "is_compatible_expressed_type",
mlir/lib/Bindings/Python/DialectQuant.cpp-      [](MlirType type, MlirType candidate) {
mlir/lib/Bindings/Python/DialectQuant.cpp-        return mlirQuantizedTypeIsCompatibleExpressedType(type, candidate);
--
mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi-  def storage_type_integral_width(self) -> int: ...
mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi-
mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi:  def is_compatible_expressed_type(self, candidate: Type) -> bool: ...
mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi-
mlir/python/mlir/_mlir_libs/_mlir/dialects/quant.pyi-  @property
--
sycl/include/CL/sycl/kernel_bundle.hpp-
sycl/include/CL/sycl/kernel_bundle.hpp-/////////////////////////
sycl/include/CL/sycl/kernel_bundle.hpp:// is_compatible API
sycl/include/CL/sycl/kernel_bundle.hpp-/////////////////////////
sycl/include/CL/sycl/kernel_bundle.hpp-
sycl/include/CL/sycl/kernel_bundle.hpp-/// \returns true if all of the kernels identified by KernelIDs are compatible
sycl/include/CL/sycl/kernel_bundle.hpp-/// with the device Dev.
sycl/include/CL/sycl/kernel_bundle.hpp:bool is_compatible(const std::vector<kernel_id> &KernelIDs, const device &Dev);
sycl/include/CL/sycl/kernel_bundle.hpp-
sycl/include/CL/sycl/kernel_bundle.hpp:template <typename KernelName> bool is_compatible(const device &Dev) {
sycl/include/CL/sycl/kernel_bundle.hpp:  return is_compatible({get_kernel_id<KernelName>()}, Dev);
sycl/include/CL/sycl/kernel_bundle.hpp-}
sycl/include/CL/sycl/kernel_bundle.hpp-

Try to compile a simple program:

#include <CL/sycl.hpp>

class Kernel;

int main() {
  for (const auto &dev : sycl::device::get_devices()) {
    bool deviceOk = sycl::is_compatible<Kernel>(dev);
    if (deviceOk) {
      sycl::queue q{dev};
      q.submit([&](sycl::handler &cgh) {
         cgh.parallel_for<Kernel>(sycl::range<1>{1}, [=](sycl::id<1> threadId) {
           int x = threadId[0];
         });
       }).wait_and_throw();
    }
  } 
  return 0;
} 
$ clang++ -fsycl is_compatible.cpp -o is_compatible
/usr/bin/ld: /tmp/iscompat-b856de.o: in function `bool cl::sycl::is_compatible<Kernel>(cl::sycl::device const&)':
iscompat-892a28.cpp:(.text._ZN2cl4sycl13is_compatibleI6KernelEEbRKNS0_6deviceE[_ZN2cl4sycl13is_compatibleI6KernelEEbRKNS0_6deviceE]+0x65): undefined reference to `cl::sycl::is_compatible(std::vector<cl::sycl::kernel_id, std::allocator<cl::sycl::kernel_id> > const&, cl::sycl::device const&)'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

Environment (please complete the following information):

  • OS: Ubuntu Linux 20.04.3
  • Target device and vendor: Intel GPU
  • DPC++ version: e211d73

Additional context

SYCL2020 reference: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:interfaces.bundles.overview.synopsis

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions