Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
50cf1529
Commit
50cf1529
authored
Jan 31, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cached commonly used device properties
parent
9041c318
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
ocl.cpp
modules/core/src/ocl.cpp
+29
-9
No files found.
modules/core/src/ocl.cpp
View file @
50cf1529
...
...
@@ -1626,6 +1626,16 @@ struct Device::Impl
{
handle
=
(
cl_device_id
)
d
;
refcount
=
1
;
name_
=
getStrProp
(
CL_DEVICE_NAME
);
version_
=
getStrProp
(
CL_DEVICE_VERSION
);
doubleFPConfig_
=
getProp
<
cl_device_fp_config
,
int
>
(
CL_DEVICE_DOUBLE_FP_CONFIG
);
hostUnifiedMemory_
=
getBoolProp
(
CL_DEVICE_HOST_UNIFIED_MEMORY
);
maxComputeUnits_
=
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_COMPUTE_UNITS
);
maxWorkGroupSize_
=
getProp
<
size_t
,
size_t
>
(
CL_DEVICE_MAX_WORK_GROUP_SIZE
);
type_
=
getProp
<
cl_device_type
,
int
>
(
CL_DEVICE_TYPE
);
deviceVersion_
=
getStrProp
(
CL_DEVICE_VERSION
);
driverVersion_
=
getStrProp
(
CL_DRIVER_VERSION
);
}
template
<
typename
_TpCL
,
typename
_TpOut
>
...
...
@@ -1657,6 +1667,16 @@ struct Device::Impl
IMPLEMENT_REFCOUNTABLE
();
cl_device_id
handle
;
String
name_
;
String
version_
;
int
doubleFPConfig_
;
bool
hostUnifiedMemory_
;
int
maxComputeUnits_
;
size_t
maxWorkGroupSize_
;
int
type_
;
String
deviceVersion_
;
String
driverVersion_
;
};
...
...
@@ -1708,13 +1728,13 @@ void* Device::ptr() const
}
String
Device
::
name
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_NAME
)
:
String
();
}
{
return
p
?
p
->
name_
:
String
();
}
String
Device
::
extensions
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_EXTENSIONS
)
:
String
();
}
String
Device
::
version
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_VERSION
)
:
String
();
}
{
return
p
?
p
->
version_
:
String
();
}
String
Device
::
vendor
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_VENDOR
)
:
String
();
}
...
...
@@ -1726,13 +1746,13 @@ String Device::OpenCLVersion() const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_EXTENSIONS
)
:
String
();
}
String
Device
::
deviceVersion
()
const
{
return
p
?
p
->
getStrProp
(
CL_DEVICE_VERSION
)
:
String
();
}
{
return
p
?
p
->
deviceVersion_
:
String
();
}
String
Device
::
driverVersion
()
const
{
return
p
?
p
->
getStrProp
(
CL_DRIVER_VERSION
)
:
String
();
}
{
return
p
?
p
->
driverVersion_
:
String
();
}
int
Device
::
type
()
const
{
return
p
?
p
->
getProp
<
cl_device_type
,
int
>
(
CL_DEVICE_TYPE
)
:
0
;
}
{
return
p
?
p
->
type_
:
0
;
}
int
Device
::
addressBits
()
const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_ADDRESS_BITS
)
:
0
;
}
...
...
@@ -1751,7 +1771,7 @@ bool Device::linkerAvailable() const
#endif
int
Device
::
doubleFPConfig
()
const
{
return
p
?
p
->
getProp
<
cl_device_fp_config
,
int
>
(
CL_DEVICE_DOUBLE_FP_CONFIG
)
:
0
;
}
{
return
p
?
p
->
doubleFPConfig_
:
0
;
}
int
Device
::
singleFPConfig
()
const
{
return
p
?
p
->
getProp
<
cl_device_fp_config
,
int
>
(
CL_DEVICE_SINGLE_FP_CONFIG
)
:
0
;
}
...
...
@@ -1791,7 +1811,7 @@ int Device::localMemType() const
{
return
p
?
p
->
getProp
<
cl_device_local_mem_type
,
int
>
(
CL_DEVICE_LOCAL_MEM_TYPE
)
:
0
;
}
bool
Device
::
hostUnifiedMemory
()
const
{
return
p
?
p
->
getBoolProp
(
CL_DEVICE_HOST_UNIFIED_MEMORY
)
:
false
;
}
{
return
p
?
p
->
hostUnifiedMemory_
:
false
;
}
bool
Device
::
imageSupport
()
const
{
return
p
?
p
->
getBoolProp
(
CL_DEVICE_IMAGE_SUPPORT
)
:
false
;
}
...
...
@@ -1829,7 +1849,7 @@ int Device::maxClockFrequency() const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_CLOCK_FREQUENCY
)
:
0
;
}
int
Device
::
maxComputeUnits
()
const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_COMPUTE_UNITS
)
:
0
;
}
{
return
p
?
p
->
maxComputeUnits_
:
0
;
}
int
Device
::
maxConstantArgs
()
const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_CONSTANT_ARGS
)
:
0
;
}
...
...
@@ -1853,7 +1873,7 @@ int Device::maxSamplers() const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_SAMPLERS
)
:
0
;
}
size_t
Device
::
maxWorkGroupSize
()
const
{
return
p
?
p
->
getProp
<
size_t
,
size_t
>
(
CL_DEVICE_MAX_WORK_GROUP_SIZE
)
:
0
;
}
{
return
p
?
p
->
maxWorkGroupSize_
:
0
;
}
int
Device
::
maxWorkItemDims
()
const
{
return
p
?
p
->
getProp
<
cl_uint
,
int
>
(
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
)
:
0
;
}
...
...
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