ViennaCL - The Vienna Computing Library  1.7.1
Free open-source GPU-accelerated linear algebra and solver library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
backend.cpp
Go to the documentation of this file.
1 /* =========================================================================
2  Copyright (c) 2010-2014, Institute for Microelectronics,
3  Institute for Analysis and Scientific Computing,
4  TU Wien.
5  Portions of this software are copyright by UChicago Argonne, LLC.
6 
7  -----------------
8  ViennaCL - The Vienna Computing Library
9  -----------------
10 
11  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
12 
13  (A list of authors and contributors can be found in the PDF manual)
14 
15  License: MIT (X11), see file LICENSE in the base directory
16 ============================================================================= */
17 
18 // include necessary system headers
19 #include <iostream>
20 
21 #include "viennacl.hpp"
22 #include "viennacl_private.hpp"
23 
24 
26 {
27  *backend = new ViennaCLBackend_impl();
28 
29  return ViennaCLSuccess;
30 }
31 
33 {
34  backend->opencl_backend.context_id = context_id;
35 
36  return ViennaCLSuccess;
37 }
38 
40 {
41  delete *backend;
42  *backend = NULL;
43 
44  return ViennaCLSuccess;
45 }
46 
Generic backend for CUDA, OpenCL, host-based stuff.
ViennaCLStatus
Definition: viennacl.hpp:97
#define VIENNACL_EXPORTED_FUNCTION
Definition: viennacl.hpp:40
ViennaCLBackend backend
ViennaCLOpenCLBackend_impl opencl_backend
int ViennaCLInt
Definition: viennacl.hpp:48
VIENNACL_EXPORTED_FUNCTION ViennaCLStatus ViennaCLBackendCreate(ViennaCLBackend *backend)
Definition: backend.cpp:25
VIENNACL_EXPORTED_FUNCTION ViennaCLStatus ViennaCLBackendSetOpenCLContextID(ViennaCLBackend backend, ViennaCLInt context_id)
Definition: backend.cpp:32
VIENNACL_EXPORTED_FUNCTION ViennaCLStatus ViennaCLBackendDestroy(ViennaCLBackend *backend)
Definition: backend.cpp:39