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
{
12
inline
namespace
_V1 {
13
namespace
detail {
14
15
// Used for sorting vector of kernel_id's
16
struct
LessByNameComp
{
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
23
struct
EqualByNameComp
{
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
32
class
kernel_id_impl
{
33
public
:
34
kernel_id_impl
(std::string Name) : MName(
std
::move(Name)) {}
35
kernel_id_impl
(){};
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 _V1
46
}
// namespace sycl
sycl::_V1::detail::LessByNameComp
Definition:
kernel_id_impl.hpp:16
sycl::_V1::detail::kernel_id_impl::get_name
const char * get_name()
Definition:
kernel_id_impl.hpp:36
sycl
Definition:
access.hpp:18
sycl::_V1::detail::EqualByNameComp
Definition:
kernel_id_impl.hpp:23
sycl::_V1::detail::kernel_id_impl::kernel_id_impl
kernel_id_impl(std::string Name)
Definition:
kernel_id_impl.hpp:34
sycl::_V1::kernel_id
Objects of the class identify kernel is some kernel_bundle related APIs.
Definition:
kernel_bundle.hpp:56
sycl::_V1::detail::EqualByNameComp::operator()
bool operator()(const sycl::kernel_id &LHS, const sycl::kernel_id &RHS) const
Definition:
kernel_id_impl.hpp:24
sycl::_V1::detail::kernel_id_impl
Definition:
kernel_id_impl.hpp:32
std
Definition:
accessor.hpp:4171
sycl::_V1::detail::LessByNameComp::operator()
bool operator()(const sycl::kernel_id &LHS, const sycl::kernel_id &RHS) const
Definition:
kernel_id_impl.hpp:17
sycl::_V1::detail::kernel_id_impl::kernel_id_impl
kernel_id_impl()
Definition:
kernel_id_impl.hpp:35
sycl::_V1::kernel_id::get_name
const char * get_name() const noexcept
Definition:
kernel_bundle.cpp:23
sycl::_V1::detail::kernel_id_impl::get_name_string
const std::string & get_name_string()
Definition:
kernel_id_impl.hpp:38
source
detail
kernel_id_impl.hpp
Generated by
1.8.17