DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
kernel_id_impl.hpp
Go to the documentation of this file.
1 //==------- kernel_id_impl.hpp - SYCL kernel_id_impl -----------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
12 namespace sycl {
13 namespace detail {
14 
15 // Used for sorting vector of kernel_id's
17  bool operator()(const sycl::kernel_id &LHS,
18  const sycl::kernel_id &RHS) const {
19  return std::strcmp(LHS.get_name(), RHS.get_name()) < 0;
20  }
21 };
22 
24  bool operator()(const sycl::kernel_id &LHS,
25  const sycl::kernel_id &RHS) const {
26  return strcmp(LHS.get_name(), RHS.get_name()) == 0;
27  }
28 };
29 
30 // The class is impl counterpart for sycl::kernel_id which represent a kernel
31 // identificator
33 public:
34  kernel_id_impl(std::string Name) : MName(std::move(Name)) {}
36  const char *get_name() { return MName.data(); }
37 
38  const std::string &get_name_string() { return MName; }
39 
40 private:
41  std::string MName;
42 };
43 
44 } // namespace detail
45 } // namespace sycl
46 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::detail::kernel_id_impl
Definition: kernel_id_impl.hpp:32
cl::sycl::detail::kernel_id_impl::get_name
const char * get_name()
Definition: kernel_id_impl.hpp:36
cl::sycl::detail::kernel_id_impl::kernel_id_impl
kernel_id_impl(std::string Name)
Definition: kernel_id_impl.hpp:34
cl::sycl::kernel_id
Objects of the class identify kernel is some kernel_bundle related APIs.
Definition: kernel_bundle.hpp:39
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::kernel_id::get_name
const char * get_name() const noexcept
Definition: kernel_bundle.cpp:20
cl::sycl::detail::LessByNameComp::operator()
bool operator()(const sycl::kernel_id &LHS, const sycl::kernel_id &RHS) const
Definition: kernel_id_impl.hpp:17
cl::sycl::detail::kernel_id_impl::kernel_id_impl
kernel_id_impl()
Definition: kernel_id_impl.hpp:35
cl::sycl::detail::EqualByNameComp
Definition: kernel_id_impl.hpp:23
cl::sycl::detail::EqualByNameComp::operator()
bool operator()(const sycl::kernel_id &LHS, const sycl::kernel_id &RHS) const
Definition: kernel_id_impl.hpp:24
std
Definition: accessor.hpp:2397
cl::sycl::detail::LessByNameComp
Definition: kernel_id_impl.hpp:16
cl::sycl::detail::kernel_id_impl::get_name_string
const std::string & get_name_string()
Definition: kernel_id_impl.hpp:38
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12