forked from triSYCL/triSYCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
host_queue.hpp
89 lines (65 loc) · 2.08 KB
/
host_queue.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef TRISYCL_SYCL_QUEUE_DETAIL_HOST_QUEUE_HPP
#define TRISYCL_SYCL_QUEUE_DETAIL_HOST_QUEUE_HPP
/** \file Some implementation details of the host queue
Ronan at Keryell point FR
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
*/
#ifdef TRISYCL_OPENCL
#include <boost/compute.hpp>
#endif
#include "CL/sycl/context.hpp"
#include "CL/sycl/detail/debug.hpp"
#include "CL/sycl/device.hpp"
#include "CL/sycl/queue/detail/queue.hpp"
namespace cl {
namespace sycl {
namespace detail {
/** Some implementation details about the SYCL queue
Note that a host queue is not a singleton, compared to host
device or host platform, for example.
*/
class host_queue : public detail::queue,
detail::debug<host_queue> {
#ifdef TRISYCL_OPENCL
/** Return the cl_command_queue of the underlying OpenCL queue
This throws an error since there is no OpenCL queue associated
to the host queue.
*/
cl_command_queue get() const override {
throw non_cl_error("The host queue has no OpenCL command queue");
}
/** Return the underlying Boost.Compute command queue
This throws an error since there is no OpenCL queue associated
to the host queue.
*/
boost::compute::command_queue &get_boost_compute() override {
throw non_cl_error("The host queue has no OpenCL command queue");
}
#endif
/// Return the SYCL host queue's host context
cl::sycl::context get_context() const override {
// Return the default context which is the host context
return {};
}
/// Return the SYCL host device the host queue is associated with
cl::sycl::device get_device() const override {
// Return the default device which is the host device
return {};
}
/// Claim proudly that the queue is executing on the SYCL host device
bool is_host() const override {
return true;
}
};
}
}
}
/*
# Some Emacs stuff:
### Local Variables:
### ispell-local-dictionary: "american"
### eval: (flyspell-prog-mode)
### End:
*/
#endif // TRISYCL_SYCL_QUEUE_DETAIL_HOST_QUEUE_HPP