HPXCL
/home/diehl/git/hpxcl/opencl/program.hpp
00001 // Copyright (c)    2013 Martin Stumpf
00002 //
00003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
00004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00005 
00006 #pragma once
00007 #ifndef HPX_OPENCL_PROGRAM_HPP_
00008 #define HPX_OPENCL_PROGRAM_HPP_
00009 
00010 // Default includes
00011 #include <hpx/hpx.hpp>
00012 #include <hpx/config.hpp>
00013 
00014 // Export definitions
00015 #include "export_definitions.hpp"
00016 
00017 // Forward Declarations
00018 #include "fwd_declarations.hpp"
00019 
00020 namespace hpx {
00021 namespace opencl { 
00022 
00023 
00029     class HPX_OPENCL_EXPORT program
00030       : public hpx::components::client_base<program, server::program>
00031     {
00032     
00033         typedef hpx::components::client_base<program, server::program> base_type;
00034 
00035         public:
00036             // Empty constructor, necessary for hpx purposes
00037             program(){}
00038 
00039             // Constructor
00040             program(hpx::shared_future<hpx::naming::id_type> const& gid,
00041                     hpx::naming::id_type device_gid_)
00042               : base_type(gid), device_gid(std::move(device_gid_))
00043             {}
00044             
00045             // initialization
00046             
00047 
00048             // ///////////////////////////////////////////////
00049             // Exposed Component functionality
00050             // 
00051  
00057             hpx::lcos::future<void> build_async() const;
00058 
00070             hpx::lcos::future<void> build_async(std::string build_options) const;
00071 
00077             void build() const;
00078 
00090             void build(std::string build_options) const;
00091 
00099             hpx::lcos::future<hpx::serialization::serialize_buffer<char> >
00100             get_binary() const;
00101 
00111             hpx::opencl::kernel
00112             create_kernel(std::string kernel_name) const;
00113 
00114         private:
00115             hpx::naming::id_type device_gid;
00116 
00117         private:
00118             // serialization support
00119             friend class hpx::serialization::access;
00120 
00121             template <typename Archive>
00122             void serialize(Archive & ar, unsigned)
00123             {
00124                 ar & hpx::serialization::base_object<base_type>(*this);
00125                 ar & device_gid;
00126             }
00127 
00128     };
00129 
00130 }}
00131 
00132 #endif
 All Classes Functions