All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viennacl_private.hpp
Go to the documentation of this file.
#ifndef VIENNACL_VIENNACL_PRIVATE_HPP
#define VIENNACL_VIENNACL_PRIVATE_HPP
/* =========================================================================
Copyright (c) 2010-2014, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the PDF manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
#include <stdlib.h>
#ifdef VIENNACL_WITH_OPENCL
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#endif
#include "viennacl.hpp"
/************* Backend Management ******************/
struct ViennaCLCUDABackend_impl
{
//TODO: Add stream and/or device descriptors here
};
struct ViennaCLOpenCLBackend_impl
{
ViennaCLInt context_id;
};
struct ViennaCLHostBackend_impl
{
// Nothing to specify *at the moment*
};
struct ViennaCLBackend_impl
{
ViennaCLBackendTypes backend_type;
ViennaCLCUDABackend_impl cuda_backend;
ViennaCLOpenCLBackend_impl opencl_backend;
ViennaCLHostBackend_impl host_backend;
};
/******** User Types **********/
struct ViennaCLHostScalar_impl
{
ViennaCLPrecision precision;
union {
float value_float;
double value_double;
};
};
struct ViennaCLScalar_impl
{
ViennaCLBackend backend;
ViennaCLPrecision precision;
// buffer:
#ifdef VIENNACL_WITH_CUDA
char * cuda_mem;
#endif
#ifdef VIENNACL_WITH_OPENCL
cl_mem opencl_mem;
#endif
char * host_mem;
ViennaCLInt offset;
};
struct ViennaCLVector_impl
{
ViennaCLBackend backend;
ViennaCLPrecision precision;
// buffer:
#ifdef VIENNACL_WITH_CUDA
char * cuda_mem;
#endif
#ifdef VIENNACL_WITH_OPENCL
cl_mem opencl_mem;
#endif
char * host_mem;
ViennaCLInt offset;
ViennaCLInt inc;
ViennaCLInt size;
};
struct ViennaCLMatrix_impl
{
ViennaCLBackend backend;
ViennaCLPrecision precision;
ViennaCLOrder order;
ViennaCLTranspose trans;
// buffer:
#ifdef VIENNACL_WITH_CUDA
char * cuda_mem;
#endif
#ifdef VIENNACL_WITH_OPENCL
cl_mem opencl_mem;
#endif
char * host_mem;
ViennaCLInt size1;
ViennaCLInt start1;
ViennaCLInt stride1;
ViennaCLInt internal_size1;
ViennaCLInt size2;
ViennaCLInt start2;
ViennaCLInt stride2;
ViennaCLInt internal_size2;
};
#endif
ViennaCLBackendTypes
ViennaCLBackendTypes
Definition: viennacl.hpp:53
ViennaCLTranspose
ViennaCLTranspose
Definition: viennacl.hpp:68
ViennaCLBackend_impl
Generic backend for CUDA, OpenCL, host-based stuff.
Definition: viennacl_private.hpp:54
ViennaCLVector_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:97
ViennaCLHostScalar_impl::value_float
float value_float
Definition: viennacl_private.hpp:72
ViennaCLMatrix_impl::start1
ViennaCLInt start1
Definition: viennacl_private.hpp:130
ViennaCLMatrix_impl::stride2
ViennaCLInt stride2
Definition: viennacl_private.hpp:136
ViennaCLBackend_impl::backend_type
ViennaCLBackendTypes backend_type
Definition: viennacl_private.hpp:56
ViennaCLMatrix_impl::internal_size2
ViennaCLInt internal_size2
Definition: viennacl_private.hpp:137
ViennaCLVector_impl::backend
ViennaCLBackend backend
Definition: viennacl_private.hpp:96
ViennaCLVector_impl::size
ViennaCLInt size
Definition: viennacl_private.hpp:110
ViennaCLBackend_impl::host_backend
ViennaCLHostBackend_impl host_backend
Definition: viennacl_private.hpp:60
ViennaCLMatrix_impl::order
ViennaCLOrder order
Definition: viennacl_private.hpp:117
ViennaCLMatrix_impl
Definition: viennacl_private.hpp:113
ViennaCLVector_impl::inc
ViennaCLInt inc
Definition: viennacl_private.hpp:109
ViennaCLVector_impl
Definition: viennacl_private.hpp:94
ViennaCLOpenCLBackend_impl::context_id
ViennaCLInt context_id
Definition: viennacl_private.hpp:44
ViennaCLMatrix_impl::backend
ViennaCLBackend backend
Definition: viennacl_private.hpp:115
ViennaCLMatrix_impl::stride1
ViennaCLInt stride1
Definition: viennacl_private.hpp:131
ViennaCLBackend_impl::opencl_backend
ViennaCLOpenCLBackend_impl opencl_backend
Definition: viennacl_private.hpp:59
ViennaCLOrder
ViennaCLOrder
Definition: viennacl.hpp:61
ViennaCLHostBackend_impl
Definition: viennacl_private.hpp:47
ViennaCLMatrix_impl::start2
ViennaCLInt start2
Definition: viennacl_private.hpp:135
ViennaCLMatrix_impl::size1
ViennaCLInt size1
Definition: viennacl_private.hpp:129
ViennaCLMatrix_impl::internal_size1
ViennaCLInt internal_size1
Definition: viennacl_private.hpp:132
ViennaCLScalar_impl::backend
ViennaCLBackend backend
Definition: viennacl_private.hpp:79
ViennaCLVector_impl::host_mem
char * host_mem
Definition: viennacl_private.hpp:106
ViennaCLScalar_impl::offset
ViennaCLInt offset
Definition: viennacl_private.hpp:91
ViennaCLScalar_impl
Definition: viennacl_private.hpp:77
ViennaCLInt
int ViennaCLInt
Definition: viennacl.hpp:48
ViennaCLScalar_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:80
ViennaCLPrecision
ViennaCLPrecision
Definition: viennacl.hpp:89
ViennaCLVector_impl::offset
ViennaCLInt offset
Definition: viennacl_private.hpp:108
ViennaCLHostScalar_impl
Definition: viennacl_private.hpp:67
ViennaCLOpenCLBackend_impl
Definition: viennacl_private.hpp:42
ViennaCLScalar_impl::host_mem
char * host_mem
Definition: viennacl_private.hpp:89
ViennaCLMatrix_impl::size2
ViennaCLInt size2
Definition: viennacl_private.hpp:134
ViennaCLMatrix_impl::trans
ViennaCLTranspose trans
Definition: viennacl_private.hpp:118
ViennaCLBackend_impl::cuda_backend
ViennaCLCUDABackend_impl cuda_backend
Definition: viennacl_private.hpp:58
ViennaCLMatrix_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:116
viennacl.hpp
ViennaCLMatrix_impl::host_mem
char * host_mem
Definition: viennacl_private.hpp:127
ViennaCLHostScalar_impl::value_double
double value_double
Definition: viennacl_private.hpp:73
ViennaCLHostScalar_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:69
ViennaCLCUDABackend_impl
Definition: viennacl_private.hpp:37