OpenCL C++ Wrapper API 1.1
 All Classes Namespaces Files Functions Variables Typedefs Defines
Public Member Functions | Static Public Member Functions
cl::Platform Class Reference

Platform interface. More...

#include <cl.hpp>

Inheritance diagram for cl::Platform:
cl::detail::Wrapper< cl_platform_id >

List of all members.

Public Member Functions

 Platform ()
 Platform (const Platform &platform)
 Platform (const cl_platform_id &platform)
Platformoperator= (const Platform &rhs)
Platformoperator= (const cl_platform_id &rhs)
cl_int getInfo (cl_platform_info name, STRING_CLASS *param) const
template<cl_int name>
detail::param_traits
< detail::cl_platform_info,
name >::param_type 
getInfo (cl_int *err=NULL) const
cl_int getDevices (cl_device_type type, VECTOR_CLASS< Device > *devices) const

Static Public Member Functions

static const Platform null ()
static cl_int get (VECTOR_CLASS< Platform > *platforms)
static cl_int get (Platform *platform)
static Platform get (cl_int *errResult=NULL)

Detailed Description

Platform interface.

Definition at line 1396 of file cl.hpp.


Constructor & Destructor Documentation

cl::Platform::Platform ( ) [inline]

Definition at line 1401 of file cl.hpp.

: detail::Wrapper<cl_type>()  { }
cl::Platform::Platform ( const Platform platform) [inline]

Definition at line 1403 of file cl.hpp.

: detail::Wrapper<cl_type>(platform) { }
cl::Platform::Platform ( const cl_platform_id &  platform) [inline]

Definition at line 1405 of file cl.hpp.

: detail::Wrapper<cl_type>(platform) { }

Member Function Documentation

static cl_int cl::Platform::get ( VECTOR_CLASS< Platform > *  platforms) [inline, static]

Definition at line 1534 of file cl.hpp.

    {
        cl_uint n = 0;
        cl_int err = ::clGetPlatformIDs(0, NULL, &n);
        if (err != CL_SUCCESS) {
            return detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
        }

        cl_platform_id* ids = (cl_platform_id*) alloca(
            n * sizeof(cl_platform_id));
        err = ::clGetPlatformIDs(n, ids, NULL);
        if (err != CL_SUCCESS) {
            return detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
        }

        platforms->assign(&ids[0], &ids[n]);
        return CL_SUCCESS;
    }
static cl_int cl::Platform::get ( Platform platform) [inline, static]

Definition at line 1554 of file cl.hpp.

    {
        cl_uint n = 0;
        cl_int err = ::clGetPlatformIDs(0, NULL, &n);
        if (err != CL_SUCCESS) {
            return detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
        }

        cl_platform_id* ids = (cl_platform_id*) alloca(
            n * sizeof(cl_platform_id));
        err = ::clGetPlatformIDs(n, ids, NULL);
        if (err != CL_SUCCESS) {
            return detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
        }

        *platform = ids[0];
        return CL_SUCCESS;
    }
static Platform cl::Platform::get ( cl_int *  errResult = NULL) [inline, static]

Definition at line 1574 of file cl.hpp.

    {
        Platform platform;
        cl_uint n = 0;
        cl_int err = ::clGetPlatformIDs(0, NULL, &n);
        if (err != CL_SUCCESS) {
            detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
            if (errResult != NULL) {
                *errResult = err;
            }
        }

        cl_platform_id* ids = (cl_platform_id*) alloca(
            n * sizeof(cl_platform_id));
        err = ::clGetPlatformIDs(n, ids, NULL);

        if (err != CL_SUCCESS) {
            detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
        }

        if (errResult != NULL) {
            *errResult = err;
        }
        
        return ids[0];
    }
cl_int cl::Platform::getDevices ( cl_device_type  type,
VECTOR_CLASS< Device > *  devices 
) const [inline]

Definition at line 1441 of file cl.hpp.

    {
        cl_uint n = 0;
        cl_int err = ::clGetDeviceIDs(object_, type, 0, NULL, &n);
        if (err != CL_SUCCESS) {
            return detail::errHandler(err, __GET_DEVICE_IDS_ERR);
        }

        cl_device_id* ids = (cl_device_id*) alloca(n * sizeof(cl_device_id));
        err = ::clGetDeviceIDs(object_, type, n, ids, NULL);
        if (err != CL_SUCCESS) {
            return detail::errHandler(err, __GET_DEVICE_IDS_ERR);
        }

        devices->assign(&ids[0], &ids[n]);
        return CL_SUCCESS;
    }
cl_int cl::Platform::getInfo ( cl_platform_info  name,
STRING_CLASS param 
) const [inline]

Definition at line 1421 of file cl.hpp.

    {
        return detail::errHandler(
            detail::getInfo(&::clGetPlatformInfo, object_, name, param),
            __GET_PLATFORM_INFO_ERR);
    }
template<cl_int name>
detail::param_traits<detail::cl_platform_info, name>::param_type cl::Platform::getInfo ( cl_int *  err = NULL) const [inline]

Definition at line 1430 of file cl.hpp.

    {
        typename detail::param_traits<
            detail::cl_platform_info, name>::param_type param;
        cl_int result = getInfo(name, &param);
        if (err != NULL) {
            *err = result;
        }
        return param;
    }
static const Platform cl::Platform::null ( ) [static]
Platform& cl::Platform::operator= ( const Platform rhs) [inline]

Definition at line 1407 of file cl.hpp.

    {
        if (this != &rhs) {
            detail::Wrapper<cl_type>::operator=(rhs);
        }
        return *this;
    }
Platform& cl::Platform::operator= ( const cl_platform_id &  rhs) [inline]

Reimplemented from cl::detail::Wrapper< cl_platform_id >.

Definition at line 1415 of file cl.hpp.

    {
        detail::Wrapper<cl_type>::operator=(rhs);
        return *this;
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Defines