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 {
friend class command<actor_facade, Ret>;
public:
typedef cow_tuple<typename detail::rm_const_and_ref<Args>::type...>
args_tuple;
using args_tuple = cow_tuple<
typename detail::rm_const_and_ref<Args>::type...>;
typedef std::function<optional<args_tuple>(any_tuple)> arg_mapping;
typedef std::function<any_tuple(Ret&)> result_mapping;
using arg_mapping = std::function<optional<args_tuple>(any_tuple)>;
using result_mapping = std::function<any_tuple(Ret&)>;
static intrusive_ptr<actor_facade>
create(const program& prog, const char* kernel_name, arg_mapping map_args,
......
......@@ -36,7 +36,7 @@ namespace opencl {
/**
* @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);
......
......@@ -30,12 +30,12 @@ namespace opencl {
template <typename T, cl_int (*ref)(T), cl_int (*deref)(T)>
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;
typedef element_type& reference;
typedef const element_type* const_pointer;
typedef const element_type& const_reference;
using pointer = element_type*;
using reference = element_type&;
using const_pointer = const element_type*;
using const_reference = const element_type&;
public:
smart_ptr(pointer ptr = nullptr) : m_ptr(ptr) {
......@@ -96,15 +96,15 @@ class smart_ptr {
pointer m_ptr;
};
typedef smart_ptr<cl_mem, clRetainMemObject, clReleaseMemObject> mem_ptr;
typedef smart_ptr<cl_event, clRetainEvent, clReleaseEvent> event_ptr;
typedef smart_ptr<cl_kernel, clRetainKernel, clReleaseKernel> kernel_ptr;
typedef smart_ptr<cl_context, clRetainContext, clReleaseContext> context_ptr;
typedef smart_ptr<cl_program, clRetainProgram, clReleaseProgram> program_ptr;
typedef smart_ptr<cl_device_id, clRetainDeviceDummy, clReleaseDeviceDummy>
device_ptr;
typedef smart_ptr<cl_command_queue, clRetainCommandQueue, clReleaseCommandQueue>
command_queue_ptr;
using mem_ptr = smart_ptr<cl_mem, clRetainMemObject, clReleaseMemObject>;
using event_ptr = smart_ptr<cl_event, clRetainEvent, clReleaseEvent>;
using kernel_ptr = smart_ptr<cl_kernel, clRetainKernel, clReleaseKernel>;
using context_ptr = smart_ptr<cl_context, clRetainContext, clReleaseContext>;
using program_ptr = smart_ptr<cl_program, clRetainProgram, clReleaseProgram>;
using device_ptr = smart_ptr<cl_device_id, clRetainDeviceDummy,
clReleaseDeviceDummy>;
using command_queue_ptr = smart_ptr<cl_command_queue, clRetainCommandQueue,
clReleaseCommandQueue>;
} // namespace opencl
} // namespace caf
......
......@@ -40,12 +40,12 @@ namespace detail {
// converts C arrays, i.e., pointers, to vectors
template <typename T>
struct carr_to_vec {
typedef T type;
using type = T;
};
template <typename T>
struct carr_to_vec<T*> {
typedef std::vector<T> type;
using type = std::vector<T>;
};
template <typename Signature, typename SecondSignature = void>
......@@ -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& local_dims = {}, size_t result_size = 0) {
using std::move;
typedef typename util::get_callable_trait<MapArgs>::fun_type f0;
typedef typename util::get_callable_trait<MapResult>::fun_type f1;
using f0 = typename util::get_callable_trait<MapArgs>::fun_type;
using f1 = typename util::get_callable_trait<MapResult>::fun_type;
detail::cl_spawn_helper<f0, f1> f;
return f(f0{move(map_args)}, f1{move(map_result)}, prog, fname, dims, offset,
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