Commit 3d59325f authored by Marian Triebe's avatar Marian Triebe

Replace old typedef syntax with using c++11 syntax

parent 89f2b66a
...@@ -55,11 +55,11 @@ class actor_facade<Ret(Args...)> : public abstract_actor { ...@@ -55,11 +55,11 @@ class actor_facade<Ret(Args...)> : public abstract_actor {
friend class command<actor_facade, Ret>; friend class command<actor_facade, Ret>;
public: public:
typedef cow_tuple<typename detail::rm_const_and_ref<Args>::type...> using args_tuple = cow_tuple<
args_tuple; typename detail::rm_const_and_ref<Args>::type...>;
typedef std::function<optional<args_tuple>(any_tuple)> arg_mapping; using arg_mapping = std::function<optional<args_tuple>(any_tuple)>;
typedef std::function<any_tuple(Ret&)> result_mapping; using result_mapping = std::function<any_tuple(Ret&)>;
static intrusive_ptr<actor_facade> static intrusive_ptr<actor_facade>
create(const program& prog, const char* kernel_name, arg_mapping map_args, create(const program& prog, const char* kernel_name, arg_mapping map_args,
......
...@@ -36,7 +36,7 @@ namespace opencl { ...@@ -36,7 +36,7 @@ namespace opencl {
/** /**
* @brief A vector of up to three elements used for OpenCL dimensions. * @brief A vector of up to three elements used for OpenCL dimensions.
*/ */
typedef detail::limited_vector<size_t, 3> dim_vec; using dim_vec = detail::limited_vector<size_t, 3>;
std::string get_opencl_error(cl_int err); std::string get_opencl_error(cl_int err);
......
...@@ -30,12 +30,12 @@ namespace opencl { ...@@ -30,12 +30,12 @@ namespace opencl {
template <typename T, cl_int (*ref)(T), cl_int (*deref)(T)> template <typename T, cl_int (*ref)(T), cl_int (*deref)(T)>
class smart_ptr { class smart_ptr {
typedef typename std::remove_pointer<T>::type element_type; using element_type = typename std::remove_pointer<T>::type;
typedef element_type* pointer; using pointer = element_type*;
typedef element_type& reference; using reference = element_type&;
typedef const element_type* const_pointer; using const_pointer = const element_type*;
typedef const element_type& const_reference; using const_reference = const element_type&;
public: public:
smart_ptr(pointer ptr = nullptr) : m_ptr(ptr) { smart_ptr(pointer ptr = nullptr) : m_ptr(ptr) {
...@@ -96,15 +96,15 @@ class smart_ptr { ...@@ -96,15 +96,15 @@ class smart_ptr {
pointer m_ptr; pointer m_ptr;
}; };
typedef smart_ptr<cl_mem, clRetainMemObject, clReleaseMemObject> mem_ptr; using mem_ptr = smart_ptr<cl_mem, clRetainMemObject, clReleaseMemObject>;
typedef smart_ptr<cl_event, clRetainEvent, clReleaseEvent> event_ptr; using event_ptr = smart_ptr<cl_event, clRetainEvent, clReleaseEvent>;
typedef smart_ptr<cl_kernel, clRetainKernel, clReleaseKernel> kernel_ptr; using kernel_ptr = smart_ptr<cl_kernel, clRetainKernel, clReleaseKernel>;
typedef smart_ptr<cl_context, clRetainContext, clReleaseContext> context_ptr; using context_ptr = smart_ptr<cl_context, clRetainContext, clReleaseContext>;
typedef smart_ptr<cl_program, clRetainProgram, clReleaseProgram> program_ptr; using program_ptr = smart_ptr<cl_program, clRetainProgram, clReleaseProgram>;
typedef smart_ptr<cl_device_id, clRetainDeviceDummy, clReleaseDeviceDummy> using device_ptr = smart_ptr<cl_device_id, clRetainDeviceDummy,
device_ptr; clReleaseDeviceDummy>;
typedef smart_ptr<cl_command_queue, clRetainCommandQueue, clReleaseCommandQueue> using command_queue_ptr = smart_ptr<cl_command_queue, clRetainCommandQueue,
command_queue_ptr; clReleaseCommandQueue>;
} // namespace opencl } // namespace opencl
} // namespace caf } // namespace caf
......
...@@ -40,12 +40,12 @@ namespace detail { ...@@ -40,12 +40,12 @@ namespace detail {
// converts C arrays, i.e., pointers, to vectors // converts C arrays, i.e., pointers, to vectors
template <typename T> template <typename T>
struct carr_to_vec { struct carr_to_vec {
typedef T type; using type = T;
}; };
template <typename T> template <typename T>
struct carr_to_vec<T*> { struct carr_to_vec<T*> {
typedef std::vector<T> type; using type = std::vector<T>;
}; };
template <typename Signature, typename SecondSignature = void> template <typename Signature, typename SecondSignature = void>
...@@ -142,8 +142,8 @@ spawn_cl(const opencl::program& prog, const char* fname, MapArgs map_args, ...@@ -142,8 +142,8 @@ spawn_cl(const opencl::program& prog, const char* fname, MapArgs map_args,
const opencl::dim_vec& offset = {}, const opencl::dim_vec& offset = {},
const opencl::dim_vec& local_dims = {}, size_t result_size = 0) { const opencl::dim_vec& local_dims = {}, size_t result_size = 0) {
using std::move; using std::move;
typedef typename util::get_callable_trait<MapArgs>::fun_type f0; using f0 = typename util::get_callable_trait<MapArgs>::fun_type;
typedef typename util::get_callable_trait<MapResult>::fun_type f1; using f1 = typename util::get_callable_trait<MapResult>::fun_type;
detail::cl_spawn_helper<f0, f1> f; detail::cl_spawn_helper<f0, f1> f;
return f(f0{move(map_args)}, f1{move(map_result)}, prog, fname, dims, offset, return f(f0{move(map_args)}, f1{move(map_result)}, prog, fname, dims, offset,
local_dims, result_size); local_dims, result_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment