DPC++ Runtime
Runtime libraries for oneAPI DPC++
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 
11 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 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
46 } // namespace sycl
const std::string & get_name_string()
#define __SYCL_INLINE_VER_NAMESPACE(X)
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
bool operator()(const sycl::kernel_id &LHS, const sycl::kernel_id &RHS) const
bool operator()(const sycl::kernel_id &LHS, const sycl::kernel_id &RHS) const