Adjust clang format to the new versions, revert broken macro layout (#714)
Cette révision appartient à :
révisé par
GitHub
Parent
ed877433f3
révision
2ff2316227
@@ -1021,9 +1021,9 @@ inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, long)
|
||||
* does not work, because when using a derived type (e.g. Context) the generic
|
||||
* template will provide a better match.
|
||||
*/
|
||||
template <typename Func, typename T>
|
||||
inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
template <typename Func, typename T> inline cl_int getInfoHelper(Func f, cl_uint name,
|
||||
VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
::size_t required;
|
||||
cl_int err = f(name, 0, NULL, &required);
|
||||
if (err != CL_SUCCESS) {
|
||||
@@ -2743,12 +2743,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
/*! \brief Class interface for Buffer Memory Objects.
|
||||
@@ -2804,9 +2802,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -2850,17 +2848,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -5321,8 +5319,8 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
const VECTOR_CLASS<const void*>* mem_locs = NULL,
|
||||
const VECTOR_CLASS<Event>* events = NULL, Event* event = NULL) const {
|
||||
cl_mem* mems = (mem_objects != NULL && mem_objects->size() > 0)
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
|
||||
if (mems != NULL) {
|
||||
for (unsigned int i = 0; i < mem_objects->size(); i++) {
|
||||
@@ -5512,9 +5510,9 @@ __attribute__((weak)) CommandQueue CommandQueue::default_;
|
||||
__attribute__((weak)) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;
|
||||
#endif // !_WIN32
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -5716,9 +5714,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ extern "C" {
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED \
|
||||
CL_EXTENSION_WEAK_LINK \
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
@@ -68,7 +68,7 @@ extern "C" {
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED \
|
||||
CL_EXTENSION_WEAK_LINK \
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
#else
|
||||
#warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
|
||||
@@ -1021,9 +1021,9 @@ inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, long)
|
||||
* does not work, because when using a derived type (e.g. Context) the generic
|
||||
* template will provide a better match.
|
||||
*/
|
||||
template <typename Func, typename T>
|
||||
inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
template <typename Func, typename T> inline cl_int getInfoHelper(Func f, cl_uint name,
|
||||
VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
::size_t required;
|
||||
cl_int err = f(name, 0, NULL, &required);
|
||||
if (err != CL_SUCCESS) {
|
||||
@@ -2743,12 +2743,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
/*! \brief Class interface for Buffer Memory Objects.
|
||||
@@ -2804,9 +2802,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -2850,17 +2848,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -5321,8 +5319,8 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
const VECTOR_CLASS<const void*>* mem_locs = NULL,
|
||||
const VECTOR_CLASS<Event>* events = NULL, Event* event = NULL) const {
|
||||
cl_mem* mems = (mem_objects != NULL && mem_objects->size() > 0)
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
|
||||
if (mems != NULL) {
|
||||
for (unsigned int i = 0; i < mem_objects->size(); i++) {
|
||||
@@ -5512,9 +5510,9 @@ __attribute__((weak)) CommandQueue CommandQueue::default_;
|
||||
__attribute__((weak)) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;
|
||||
#endif // !_WIN32
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -5716,9 +5714,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
@@ -1765,9 +1765,8 @@ template <typename T> inline bool operator!=(const Wrapper<T>& lhs, const Wrappe
|
||||
|
||||
|
||||
using BuildLogType =
|
||||
vector<std::pair<cl::Device,
|
||||
typename detail::param_traits<detail::cl_program_build_info,
|
||||
CL_PROGRAM_BUILD_LOG>::param_type>>;
|
||||
vector<std::pair<cl::Device, typename detail::param_traits<detail::cl_program_build_info,
|
||||
CL_PROGRAM_BUILD_LOG>::param_type>>;
|
||||
#if defined(CL_HPP_ENABLE_EXCEPTIONS)
|
||||
/**
|
||||
* Exception class for build errors to carry build info
|
||||
@@ -2961,12 +2960,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
#if CL_HPP_TARGET_OPENCL_VERSION >= 200
|
||||
@@ -3053,8 +3050,8 @@ template <typename T, class SVMTrait> class SVMAllocator {
|
||||
|
||||
SVMAllocator(const SVMAllocator& other) : context_(other.context_) {}
|
||||
|
||||
template <typename U>
|
||||
SVMAllocator(const SVMAllocator<U, SVMTrait>& other) : context_(other.context_) {}
|
||||
template <typename U> SVMAllocator(const SVMAllocator<U, SVMTrait>& other)
|
||||
: context_(other.context_) {}
|
||||
|
||||
~SVMAllocator() {}
|
||||
|
||||
@@ -3272,9 +3269,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -3318,17 +3315,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must be random access.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -4828,8 +4825,7 @@ template <typename T, class Enable = void> struct KernelArgumentHandler;
|
||||
|
||||
// Enable for objects that are not subclasses of memory
|
||||
// Pointers, constants etc
|
||||
template <typename T>
|
||||
struct KernelArgumentHandler<
|
||||
template <typename T> struct KernelArgumentHandler<
|
||||
T, typename std::enable_if<!std::is_base_of<cl::Memory, T>::value>::type> {
|
||||
static size_type size(const T&) { return sizeof(T); }
|
||||
static const T* ptr(const T& value) { return &value; }
|
||||
@@ -4992,9 +4988,8 @@ class Kernel : public detail::Wrapper<cl_kernel> {
|
||||
__GET_KERNEL_ARG_INFO_ERR);
|
||||
}
|
||||
|
||||
template <cl_int name>
|
||||
size_type getSubGroupInfo(const cl::Device& dev, const cl::NDRange& range,
|
||||
cl_int* err = NULL) const {
|
||||
template <cl_int name> size_type getSubGroupInfo(const cl::Device& dev, const cl::NDRange& range,
|
||||
cl_int* err = NULL) const {
|
||||
size_type param;
|
||||
cl_int result = getSubGroupInfo(dev, name, range, ¶m);
|
||||
if (err != NULL) {
|
||||
@@ -5591,9 +5586,8 @@ inline Program linkProgram(vector<Program> inputPrograms, const char* options =
|
||||
#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120
|
||||
|
||||
// Template specialization for CL_PROGRAM_BINARIES
|
||||
template <>
|
||||
inline cl_int cl::Program::getInfo(cl_program_info name,
|
||||
vector<vector<unsigned char>>* param) const {
|
||||
template <> inline cl_int cl::Program::getInfo(cl_program_info name,
|
||||
vector<vector<unsigned char>>* param) const {
|
||||
if (name != CL_PROGRAM_BINARIES) {
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
@@ -6367,9 +6361,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a raw SVM pointer.
|
||||
*/
|
||||
template <typename T>
|
||||
cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events = NULL, Event* event = NULL) const {
|
||||
template <typename T> cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMMap(
|
||||
@@ -6468,9 +6462,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
template <typename T, class D> cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMUnmap(
|
||||
@@ -6488,9 +6482,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::vector instance.
|
||||
*/
|
||||
template <typename T, class Alloc>
|
||||
cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
template <typename T, class Alloc> cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMUnmap(
|
||||
@@ -6827,8 +6821,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl::Context context = cl::Context::getDefault();
|
||||
cl::Device device = cl::Device::getDefault();
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
@@ -6847,8 +6842,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl_int* err = NULL) {
|
||||
cl_int error;
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
|
||||
@@ -6866,8 +6862,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl_int* err = NULL) {
|
||||
cl_int error;
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, CL_QUEUE_SIZE,
|
||||
queueSize, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
@@ -7021,9 +7018,9 @@ template <> struct KernelArgumentHandler<cl::DeviceCommandQueue, void> {
|
||||
#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200
|
||||
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -7163,9 +7160,9 @@ inline void* enqueueMapBuffer(const Buffer& buffer, cl_bool blocking, cl_map_fla
|
||||
* update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a raw SVM pointer.
|
||||
*/
|
||||
template <typename T>
|
||||
inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events, Event* event) {
|
||||
template <typename T> inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events,
|
||||
Event* event) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7180,10 +7177,10 @@ inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_t
|
||||
* update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
inline cl_int enqueueMapSVM(cl::pointer<T, D> ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class D> inline cl_int enqueueMapSVM(cl::pointer<T, D> ptr, cl_bool blocking,
|
||||
cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7257,9 +7254,9 @@ inline cl_int enqueueUnmapSVM(T* ptr, const vector<Event>* events = NULL, Event*
|
||||
* SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class D> inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7275,9 +7272,9 @@ inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* event
|
||||
* SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::vector instance.
|
||||
*/
|
||||
template <typename T, class Alloc>
|
||||
inline cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class Alloc> inline cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7336,9 +7333,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ extern "C" {
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED \
|
||||
CL_EXTENSION_WEAK_LINK \
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
@@ -76,7 +76,7 @@ extern "C" {
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED \
|
||||
CL_EXTENSION_WEAK_LINK \
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
#else
|
||||
#warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
|
||||
@@ -1021,9 +1021,9 @@ inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, long)
|
||||
* does not work, because when using a derived type (e.g. Context) the generic
|
||||
* template will provide a better match.
|
||||
*/
|
||||
template <typename Func, typename T>
|
||||
inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
template <typename Func, typename T> inline cl_int getInfoHelper(Func f, cl_uint name,
|
||||
VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
::size_t required;
|
||||
cl_int err = f(name, 0, NULL, &required);
|
||||
if (err != CL_SUCCESS) {
|
||||
@@ -2743,12 +2743,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
/*! \brief Class interface for Buffer Memory Objects.
|
||||
@@ -2804,9 +2802,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -2850,17 +2848,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -5321,8 +5319,8 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
const VECTOR_CLASS<const void*>* mem_locs = NULL,
|
||||
const VECTOR_CLASS<Event>* events = NULL, Event* event = NULL) const {
|
||||
cl_mem* mems = (mem_objects != NULL && mem_objects->size() > 0)
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
|
||||
if (mems != NULL) {
|
||||
for (unsigned int i = 0; i < mem_objects->size(); i++) {
|
||||
@@ -5512,9 +5510,9 @@ __attribute__((weak)) CommandQueue CommandQueue::default_;
|
||||
__attribute__((weak)) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;
|
||||
#endif // !_WIN32
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -5716,9 +5714,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
@@ -1765,9 +1765,8 @@ template <typename T> inline bool operator!=(const Wrapper<T>& lhs, const Wrappe
|
||||
|
||||
|
||||
using BuildLogType =
|
||||
vector<std::pair<cl::Device,
|
||||
typename detail::param_traits<detail::cl_program_build_info,
|
||||
CL_PROGRAM_BUILD_LOG>::param_type>>;
|
||||
vector<std::pair<cl::Device, typename detail::param_traits<detail::cl_program_build_info,
|
||||
CL_PROGRAM_BUILD_LOG>::param_type>>;
|
||||
#if defined(CL_HPP_ENABLE_EXCEPTIONS)
|
||||
/**
|
||||
* Exception class for build errors to carry build info
|
||||
@@ -2961,12 +2960,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
#if CL_HPP_TARGET_OPENCL_VERSION >= 200
|
||||
@@ -3053,8 +3050,8 @@ template <typename T, class SVMTrait> class SVMAllocator {
|
||||
|
||||
SVMAllocator(const SVMAllocator& other) : context_(other.context_) {}
|
||||
|
||||
template <typename U>
|
||||
SVMAllocator(const SVMAllocator<U, SVMTrait>& other) : context_(other.context_) {}
|
||||
template <typename U> SVMAllocator(const SVMAllocator<U, SVMTrait>& other)
|
||||
: context_(other.context_) {}
|
||||
|
||||
~SVMAllocator() {}
|
||||
|
||||
@@ -3272,9 +3269,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -3318,17 +3315,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must be random access.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -4828,8 +4825,7 @@ template <typename T, class Enable = void> struct KernelArgumentHandler;
|
||||
|
||||
// Enable for objects that are not subclasses of memory
|
||||
// Pointers, constants etc
|
||||
template <typename T>
|
||||
struct KernelArgumentHandler<
|
||||
template <typename T> struct KernelArgumentHandler<
|
||||
T, typename std::enable_if<!std::is_base_of<cl::Memory, T>::value>::type> {
|
||||
static size_type size(const T&) { return sizeof(T); }
|
||||
static const T* ptr(const T& value) { return &value; }
|
||||
@@ -4992,9 +4988,8 @@ class Kernel : public detail::Wrapper<cl_kernel> {
|
||||
__GET_KERNEL_ARG_INFO_ERR);
|
||||
}
|
||||
|
||||
template <cl_int name>
|
||||
size_type getSubGroupInfo(const cl::Device& dev, const cl::NDRange& range,
|
||||
cl_int* err = NULL) const {
|
||||
template <cl_int name> size_type getSubGroupInfo(const cl::Device& dev, const cl::NDRange& range,
|
||||
cl_int* err = NULL) const {
|
||||
size_type param;
|
||||
cl_int result = getSubGroupInfo(dev, name, range, ¶m);
|
||||
if (err != NULL) {
|
||||
@@ -5591,9 +5586,8 @@ inline Program linkProgram(vector<Program> inputPrograms, const char* options =
|
||||
#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120
|
||||
|
||||
// Template specialization for CL_PROGRAM_BINARIES
|
||||
template <>
|
||||
inline cl_int cl::Program::getInfo(cl_program_info name,
|
||||
vector<vector<unsigned char>>* param) const {
|
||||
template <> inline cl_int cl::Program::getInfo(cl_program_info name,
|
||||
vector<vector<unsigned char>>* param) const {
|
||||
if (name != CL_PROGRAM_BINARIES) {
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
@@ -6367,9 +6361,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a raw SVM pointer.
|
||||
*/
|
||||
template <typename T>
|
||||
cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events = NULL, Event* event = NULL) const {
|
||||
template <typename T> cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMMap(
|
||||
@@ -6468,9 +6462,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
template <typename T, class D> cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMUnmap(
|
||||
@@ -6488,9 +6482,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::vector instance.
|
||||
*/
|
||||
template <typename T, class Alloc>
|
||||
cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
template <typename T, class Alloc> cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMUnmap(
|
||||
@@ -6827,8 +6821,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl::Context context = cl::Context::getDefault();
|
||||
cl::Device device = cl::Device::getDefault();
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
@@ -6847,8 +6842,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl_int* err = NULL) {
|
||||
cl_int error;
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
|
||||
@@ -6866,8 +6862,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl_int* err = NULL) {
|
||||
cl_int error;
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, CL_QUEUE_SIZE,
|
||||
queueSize, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
@@ -7021,9 +7018,9 @@ template <> struct KernelArgumentHandler<cl::DeviceCommandQueue, void> {
|
||||
#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200
|
||||
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -7163,9 +7160,9 @@ inline void* enqueueMapBuffer(const Buffer& buffer, cl_bool blocking, cl_map_fla
|
||||
* update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a raw SVM pointer.
|
||||
*/
|
||||
template <typename T>
|
||||
inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events, Event* event) {
|
||||
template <typename T> inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events,
|
||||
Event* event) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7180,10 +7177,10 @@ inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_t
|
||||
* update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
inline cl_int enqueueMapSVM(cl::pointer<T, D> ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class D> inline cl_int enqueueMapSVM(cl::pointer<T, D> ptr, cl_bool blocking,
|
||||
cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7257,9 +7254,9 @@ inline cl_int enqueueUnmapSVM(T* ptr, const vector<Event>* events = NULL, Event*
|
||||
* SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class D> inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7275,9 +7272,9 @@ inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* event
|
||||
* SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::vector instance.
|
||||
*/
|
||||
template <typename T, class Alloc>
|
||||
inline cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class Alloc> inline cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7336,9 +7333,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ extern "C" {
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED \
|
||||
CL_EXTENSION_WEAK_LINK \
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
|
||||
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
@@ -76,7 +76,7 @@ extern "C" {
|
||||
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
|
||||
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED \
|
||||
CL_EXTENSION_WEAK_LINK \
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
|
||||
#else
|
||||
#warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
|
||||
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
|
||||
@@ -1009,9 +1009,9 @@ inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, long)
|
||||
* does not work, because when using a derived type (e.g. Context) the generic
|
||||
* template will provide a better match.
|
||||
*/
|
||||
template <typename Func, typename T>
|
||||
inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
template <typename Func, typename T> inline cl_int getInfoHelper(Func f, cl_uint name,
|
||||
VECTOR_CLASS<T>* param, int,
|
||||
typename T::cl_type = 0) {
|
||||
::size_t required;
|
||||
cl_int err = f(name, 0, NULL, &required);
|
||||
if (err != CL_SUCCESS) {
|
||||
@@ -2736,12 +2736,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
/*! \brief Class interface for Buffer Memory Objects.
|
||||
@@ -2797,9 +2795,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -2843,17 +2841,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -5314,8 +5312,8 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
const VECTOR_CLASS<const void*>* mem_locs = NULL,
|
||||
const VECTOR_CLASS<Event>* events = NULL, Event* event = NULL) const {
|
||||
cl_mem* mems = (mem_objects != NULL && mem_objects->size() > 0)
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
? (cl_mem*)alloca(mem_objects->size() * sizeof(cl_mem))
|
||||
: NULL;
|
||||
|
||||
if (mems != NULL) {
|
||||
for (unsigned int i = 0; i < mem_objects->size(); i++) {
|
||||
@@ -5505,9 +5503,9 @@ __attribute__((weak)) CommandQueue CommandQueue::default_;
|
||||
__attribute__((weak)) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;
|
||||
#endif // !_WIN32
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -5709,9 +5707,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
@@ -1753,9 +1753,8 @@ template <typename T> inline bool operator!=(const Wrapper<T>& lhs, const Wrappe
|
||||
|
||||
|
||||
using BuildLogType =
|
||||
vector<std::pair<cl::Device,
|
||||
typename detail::param_traits<detail::cl_program_build_info,
|
||||
CL_PROGRAM_BUILD_LOG>::param_type>>;
|
||||
vector<std::pair<cl::Device, typename detail::param_traits<detail::cl_program_build_info,
|
||||
CL_PROGRAM_BUILD_LOG>::param_type>>;
|
||||
#if defined(CL_HPP_ENABLE_EXCEPTIONS)
|
||||
/**
|
||||
* Exception class for build errors to carry build info
|
||||
@@ -2951,12 +2950,10 @@ template <typename IteratorType>
|
||||
cl_int copy(IteratorType startIterator, IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer);
|
||||
template <typename IteratorType>
|
||||
cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer, IteratorType startIterator,
|
||||
IteratorType endIterator);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer);
|
||||
template <typename IteratorType> cl_int copy(const CommandQueue& queue, const cl::Buffer& buffer,
|
||||
IteratorType startIterator, IteratorType endIterator);
|
||||
|
||||
|
||||
#if CL_HPP_TARGET_OPENCL_VERSION >= 200
|
||||
@@ -3043,8 +3040,8 @@ template <typename T, class SVMTrait> class SVMAllocator {
|
||||
|
||||
SVMAllocator(const SVMAllocator& other) : context_(other.context_) {}
|
||||
|
||||
template <typename U>
|
||||
SVMAllocator(const SVMAllocator<U, SVMTrait>& other) : context_(other.context_) {}
|
||||
template <typename U> SVMAllocator(const SVMAllocator<U, SVMTrait>& other)
|
||||
: context_(other.context_) {}
|
||||
|
||||
~SVMAllocator() {}
|
||||
|
||||
@@ -3262,9 +3259,9 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(IteratorType startIterator, IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL) {
|
||||
template <typename IteratorType> Buffer(IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false,
|
||||
cl_int* err = NULL) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -3308,17 +3305,17 @@ class Buffer : public Memory {
|
||||
* IteratorType must be random access.
|
||||
* If useHostPtr is specified iterators must represent contiguous data.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
/*!
|
||||
* \brief Construct a Buffer from a host container via iterators using a specified queue.
|
||||
* If useHostPtr is specified iterators must be random access.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
Buffer(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
|
||||
template <typename IteratorType> Buffer(const CommandQueue& queue, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr = false, cl_int* err = NULL);
|
||||
|
||||
//! \brief Default constructor - initializes to NULL.
|
||||
Buffer() : Memory() {}
|
||||
@@ -4818,8 +4815,7 @@ template <typename T, class Enable = void> struct KernelArgumentHandler;
|
||||
|
||||
// Enable for objects that are not subclasses of memory
|
||||
// Pointers, constants etc
|
||||
template <typename T>
|
||||
struct KernelArgumentHandler<
|
||||
template <typename T> struct KernelArgumentHandler<
|
||||
T, typename std::enable_if<!std::is_base_of<cl::Memory, T>::value>::type> {
|
||||
static size_type size(const T&) { return sizeof(T); }
|
||||
static const T* ptr(const T& value) { return &value; }
|
||||
@@ -4982,9 +4978,8 @@ class Kernel : public detail::Wrapper<cl_kernel> {
|
||||
__GET_KERNEL_ARG_INFO_ERR);
|
||||
}
|
||||
|
||||
template <cl_int name>
|
||||
size_type getSubGroupInfo(const cl::Device& dev, const cl::NDRange& range,
|
||||
cl_int* err = NULL) const {
|
||||
template <cl_int name> size_type getSubGroupInfo(const cl::Device& dev, const cl::NDRange& range,
|
||||
cl_int* err = NULL) const {
|
||||
size_type param;
|
||||
cl_int result = getSubGroupInfo(dev, name, range, ¶m);
|
||||
if (err != NULL) {
|
||||
@@ -5581,9 +5576,8 @@ inline Program linkProgram(vector<Program> inputPrograms, const char* options =
|
||||
#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120
|
||||
|
||||
// Template specialization for CL_PROGRAM_BINARIES
|
||||
template <>
|
||||
inline cl_int cl::Program::getInfo(cl_program_info name,
|
||||
vector<vector<unsigned char>>* param) const {
|
||||
template <> inline cl_int cl::Program::getInfo(cl_program_info name,
|
||||
vector<vector<unsigned char>>* param) const {
|
||||
if (name != CL_PROGRAM_BINARIES) {
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
@@ -6357,9 +6351,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a raw SVM pointer.
|
||||
*/
|
||||
template <typename T>
|
||||
cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events = NULL, Event* event = NULL) const {
|
||||
template <typename T> cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMMap(
|
||||
@@ -6458,9 +6452,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
template <typename T, class D> cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMUnmap(
|
||||
@@ -6478,9 +6472,9 @@ class CommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
* Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::vector instance.
|
||||
*/
|
||||
template <typename T, class Alloc>
|
||||
cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
template <typename T, class Alloc> cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) const {
|
||||
cl_event tmp;
|
||||
cl_int err = detail::errHandler(
|
||||
::clEnqueueSVMUnmap(
|
||||
@@ -6817,8 +6811,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl::Context context = cl::Context::getDefault();
|
||||
cl::Device device = cl::Device::getDefault();
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
@@ -6837,8 +6832,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl_int* err = NULL) {
|
||||
cl_int error;
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
|
||||
@@ -6856,8 +6852,9 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue> {
|
||||
cl_int* err = NULL) {
|
||||
cl_int error;
|
||||
|
||||
cl_command_queue_properties mergedProperties = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
|
||||
CL_QUEUE_ON_DEVICE | static_cast<cl_command_queue_properties>(properties);
|
||||
cl_command_queue_properties mergedProperties =
|
||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE |
|
||||
static_cast<cl_command_queue_properties>(properties);
|
||||
cl_queue_properties queue_properties[] = {CL_QUEUE_PROPERTIES, mergedProperties, CL_QUEUE_SIZE,
|
||||
queueSize, 0};
|
||||
object_ = ::clCreateCommandQueueWithProperties(context(), device(), queue_properties, &error);
|
||||
@@ -7011,9 +7008,9 @@ template <> struct KernelArgumentHandler<cl::DeviceCommandQueue, void> {
|
||||
#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200
|
||||
|
||||
|
||||
template <typename IteratorType>
|
||||
Buffer::Buffer(const Context& context, IteratorType startIterator, IteratorType endIterator,
|
||||
bool readOnly, bool useHostPtr, cl_int* err) {
|
||||
template <typename IteratorType> Buffer::Buffer(const Context& context, IteratorType startIterator,
|
||||
IteratorType endIterator, bool readOnly,
|
||||
bool useHostPtr, cl_int* err) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
@@ -7153,9 +7150,9 @@ inline void* enqueueMapBuffer(const Buffer& buffer, cl_bool blocking, cl_map_fla
|
||||
* update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a raw SVM pointer.
|
||||
*/
|
||||
template <typename T>
|
||||
inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events, Event* event) {
|
||||
template <typename T> inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events,
|
||||
Event* event) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7170,10 +7167,10 @@ inline cl_int enqueueMapSVM(T* ptr, cl_bool blocking, cl_map_flags flags, size_t
|
||||
* update a region of a coarse-grained SVM buffer.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
inline cl_int enqueueMapSVM(cl::pointer<T, D> ptr, cl_bool blocking, cl_map_flags flags,
|
||||
size_type size, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class D> inline cl_int enqueueMapSVM(cl::pointer<T, D> ptr, cl_bool blocking,
|
||||
cl_map_flags flags, size_type size,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7247,9 +7244,9 @@ inline cl_int enqueueUnmapSVM(T* ptr, const vector<Event>* events = NULL, Event*
|
||||
* SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::pointer instance.
|
||||
*/
|
||||
template <typename T, class D>
|
||||
inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class D> inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7265,9 +7262,9 @@ inline cl_int enqueueUnmapSVM(cl::pointer<T, D>& ptr, const vector<Event>* event
|
||||
* SVM buffer back to the OpenCL runtime.
|
||||
* This variant takes a cl::vector instance.
|
||||
*/
|
||||
template <typename T, class Alloc>
|
||||
inline cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container, const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
template <typename T, class Alloc> inline cl_int enqueueUnmapSVM(cl::vector<T, Alloc>& container,
|
||||
const vector<Event>* events = NULL,
|
||||
Event* event = NULL) {
|
||||
cl_int error;
|
||||
CommandQueue queue = CommandQueue::getDefault(&error);
|
||||
if (error != CL_SUCCESS) {
|
||||
@@ -7326,9 +7323,9 @@ inline cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, Iterato
|
||||
* Host to Device.
|
||||
* Uses specified queue.
|
||||
*/
|
||||
template <typename IteratorType>
|
||||
inline cl_int copy(const CommandQueue& queue, IteratorType startIterator, IteratorType endIterator,
|
||||
cl::Buffer& buffer) {
|
||||
template <typename IteratorType> inline cl_int copy(const CommandQueue& queue,
|
||||
IteratorType startIterator,
|
||||
IteratorType endIterator, cl::Buffer& buffer) {
|
||||
typedef typename std::iterator_traits<IteratorType>::value_type DataType;
|
||||
cl_int error;
|
||||
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur