3
#ifndef OPENCV_CORE_OPENCL_SVM_HPP
4
#define OPENCV_CORE_OPENCL_SVM_HPP
10
#error Internal header file
13
#if defined(HAVE_OPENCL) && defined(HAVE_OPENCL_SVM)
14
#include "runtime/opencl_core.hpp"
15
#include "runtime/opencl_svm_20.hpp"
16
#include "runtime/opencl_svm_hsa_extension.hpp"
18
namespace
cv
{
namespace
ocl {
namespace
svm {
20
struct
SVMCapabilities
24
SVM_COARSE_GRAIN_BUFFER = (1 << 0),
25
SVM_FINE_GRAIN_BUFFER = (1 << 1),
26
SVM_FINE_GRAIN_SYSTEM = (1 << 2),
27
SVM_ATOMICS = (1 << 3),
31
SVMCapabilities(
int
capabilities = 0) : value_(capabilities) { }
32
operator
int()
const
{
return
value_; }
34
inline
bool
isNoSVMSupport()
const
{
return
value_ == 0; }
35
inline
bool
isSupportCoarseGrainBuffer()
const
{
return
(value_ & SVM_COARSE_GRAIN_BUFFER) != 0; }
36
inline
bool
isSupportFineGrainBuffer()
const
{
return
(value_ & SVM_FINE_GRAIN_BUFFER) != 0; }
37
inline
bool
isSupportFineGrainSystem()
const
{
return
(value_ & SVM_FINE_GRAIN_SYSTEM) != 0; }
38
inline
bool
isSupportAtomics()
const
{
return
(value_ & SVM_ATOMICS) != 0; }
41CV_EXPORTS
const
SVMCapabilities getSVMCapabilitites(
const
ocl::Context& context);
45
clSVMAllocAMD_fn fn_clSVMAlloc;
46
clSVMFreeAMD_fn fn_clSVMFree;
47
clSetKernelArgSVMPointerAMD_fn fn_clSetKernelArgSVMPointer;
50
clEnqueueSVMMemcpyAMD_fn fn_clEnqueueSVMMemcpy;
51
clEnqueueSVMMemFillAMD_fn fn_clEnqueueSVMMemFill;
52
clEnqueueSVMMapAMD_fn fn_clEnqueueSVMMap;
53
clEnqueueSVMUnmapAMD_fn fn_clEnqueueSVMUnmap;
56
: fn_clSVMAlloc(NULL), fn_clSVMFree(NULL),
57
fn_clSetKernelArgSVMPointer(NULL),
58
fn_clEnqueueSVMMemcpy(NULL), fn_clEnqueueSVMMemFill(NULL),
59
fn_clEnqueueSVMMap(NULL), fn_clEnqueueSVMUnmap(NULL)
64
inline
bool
isValid()
const
66
return
fn_clSVMAlloc != NULL && fn_clSVMFree && fn_clSetKernelArgSVMPointer &&
67
fn_clEnqueueSVMMemcpy &&
68
fn_clEnqueueSVMMemFill && fn_clEnqueueSVMMap && fn_clEnqueueSVMUnmap;
73CV_EXPORTS
const
SVMFunctions* getSVMFunctions(
const
ocl::Context& context);
UMatUsageFlags
Usage flags for allocator
Definition:
mat.hpp:454
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75