FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
taskflow/examples/sycl/sycl_device.cpp at master · ModuleWorks/taskflow · GitHub
ModuleWorks
/
taskflow
Public
forked from
taskflow/taskflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
taskflow
/
examples
/
sycl
/
sycl_device.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (46 loc) · 2.17 KB
Breadcrumbs
taskflow
/
examples
/
sycl
/
sycl_device.cpp
Copy path
File metadata and controls
57 lines (46 loc) · 2.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
//
This program pulls out all platforms and devices using SYCL.
#
include
<
taskflow/sycl/syclflow.hpp
>
int
main
() {
std::vector<sycl::platform> platforms =
sycl::platform::get_platforms
();
//
looping over platforms
for
(
const
auto
& platform : platforms) {
std::cout <<
"
Platform :
"
<< platform.
get_info
<sycl::info::platform::name>() <<
'
\n
'
<<
"
is_host :
"
<< platform.
is_host
() <<
'
\n
'
<<
"
version :
"
<< platform.
get_info
<sycl::info::platform::version>() <<
'
\n
'
<<
"
vendor :
"
<< platform.
get_info
<sycl::info::platform::vendor>() <<
'
\n
'
<<
"
profile :
"
<< platform.
get_info
<sycl::info::platform::profile>() <<
'
\n
'
;
//
<< "extensions :"
//
<< platform.get_info<sycl::info::platform::extensions>() << '\n';
//
getting the list of devices from the platform
std::vector<sycl::device> devices = platform.
get_devices
();
//
looping over devices
for
(
const
auto
& device : devices) {
std::cout <<
"
Device :
"
<< device.
get_info
<sycl::info::device::name>() <<
'
\n
'
<<
"
vendor :
"
<< device.
get_info
<sycl::info::device::vendor>() <<
'
\n
'
<<
"
version :
"
<< device.
get_info
<sycl::info::device::version>() <<
'
\n
'
<<
"
is_host :
"
<< device.
is_host
() <<
'
\n
'
<<
"
is_cpu :
"
<< device.
is_cpu
() <<
'
\n
'
<<
"
is_gpu :
"
<< device.
is_gpu
() <<
'
\n
'
<<
"
is_accelerator :
"
<< device.
is_accelerator
() <<
'
\n
'
<<
"
max_work_group_size:
"
<< device.
get_info
<sycl::info::device::max_work_group_size>() <<
'
\n
'
<<
"
local_mem_size :
"
<< device.
get_info
<sycl::info::device::local_mem_size>() <<
'
\n
'
;
//
submitting a kernel to the sycl device
auto
queue =
sycl::queue
(device);
queue.
submit
([](sycl::handler& handler){
handler.
single_task
([](){});
});
}
std::cout << std::endl;
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL