Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CT Input Output Library
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
kulvait
CT Input Output Library
Commits
194e0e8e
Commit
194e0e8e
authored
Nov 02, 2020
by
kulvait
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New function getPlatformName in OpenCLManager
parent
dc9f5e2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
include/OPENCL/OpenCLManager.hpp
include/OPENCL/OpenCLManager.hpp
+3
-1
src/OPENCL/OpenCLManager.cpp
src/OPENCL/OpenCLManager.cpp
+14
-0
No files found.
include/OPENCL/OpenCLManager.hpp
View file @
194e0e8e
...
...
@@ -15,7 +15,9 @@ namespace util {
{
public:
static
uint32_t
platformCount
();
static
std
::
shared_ptr
<
cl
::
Platform
>
getPlatform
(
uint32_t
platformID
=
0
,
bool
verbose
=
false
);
static
std
::
shared_ptr
<
cl
::
Platform
>
getPlatform
(
uint32_t
platformID
=
0
,
bool
verbose
=
false
);
static
std
::
string
getPlatformName
(
uint32_t
platformID
);
static
uint32_t
deviceCount
(
uint32_t
platformID
);
static
std
::
shared_ptr
<
cl
::
Device
>
getDevice
(
const
cl
::
Platform
&
platform
,
uint32_t
deviceID
=
0
,
bool
verbose
=
false
);
...
...
src/OPENCL/OpenCLManager.cpp
View file @
194e0e8e
...
...
@@ -35,6 +35,20 @@ namespace util {
return
std
::
make_shared
<
cl
::
Platform
>
(
all_platforms
[
platformID
]);
}
std
::
string
OpenCLManager
::
getPlatformName
(
uint32_t
platformID
)
{
std
::
vector
<
cl
::
Platform
>
all_platforms
;
cl
::
Platform
::
get
(
&
all_platforms
);
if
(
all_platforms
.
size
()
<=
platformID
)
{
LOGE
<<
io
::
xprintf
(
"There is just %d OpenCL platforms on the PC and you selected "
"invalplatformID zero based index %d."
,
all_platforms
.
size
(),
platformID
);
return
nullptr
;
}
return
all_platforms
[
platformID
].
getInfo
<
CL_PLATFORM_NAME
>
().
c_str
();
}
uint32_t
OpenCLManager
::
deviceCount
(
uint32_t
platformID
)
{
std
::
vector
<
cl
::
Device
>
all_devices
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment