DPC++ Runtime
Runtime libraries for oneAPI DPC++
context_info.hpp
Go to the documentation of this file.
1
//==---------------- context_info.hpp - SYCL context -----------*- C++ -*---==//
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
#include <
detail/context_impl.hpp
>
12
#include <
sycl/detail/common.hpp
>
13
#include <
sycl/detail/info_desc_helpers.hpp
>
14
#include <
sycl/info/info_desc.hpp
>
15
16
namespace
sycl
{
17
inline
namespace
_V1 {
18
namespace
detail {
19
20
template
<
typename
Param>
21
typename
Param::return_type
get_context_info
(
sycl::detail::pi::PiContext
Ctx,
22
const
PluginPtr
&Plugin) {
23
static_assert(
is_context_info_desc<Param>::value
,
24
"Invalid context information descriptor"
);
25
typename
Param::return_type Result = 0;
26
// TODO catch an exception and put it to list of asynchronous exceptions
27
Plugin->call<
PiApiKind::piContextGetInfo
>(Ctx,
PiInfoCode<Param>::value
,
28
sizeof
(Result), &Result,
nullptr
);
29
return
Result;
30
}
31
32
}
// namespace detail
33
}
// namespace _V1
34
}
// namespace sycl
context_impl.hpp
common.hpp
info_desc.hpp
info_desc_helpers.hpp
sycl::_V1::detail::get_context_info
Param::return_type get_context_info(sycl::detail::pi::PiContext Ctx, const PluginPtr &Plugin)
Definition:
context_info.hpp:21
sycl::_V1::detail::PluginPtr
std::shared_ptr< plugin > PluginPtr
Definition:
pi.hpp:48
sycl
Definition:
access.hpp:18
piContextGetInfo
pi_result piContextGetInfo(pi_context context, pi_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition:
pi_cuda.cpp:124
_pi_context
Definition:
pi_cuda.hpp:52
sycl::_V1::detail::PiInfoCode
Definition:
info_desc_helpers.hpp:25
sycl::_V1::detail::is_context_info_desc
Definition:
info_desc_helpers.hpp:27
source
detail
context_info.hpp
Generated by
1.9.1