1 #ifndef VIENNACL_LINALG_OPENCL_COMMON_HPP_
2 #define VIENNACL_LINALG_OPENCL_COMMON_HPP_
42 template<
typename NumericT>
51 program = &ctx.
get_program(KernelClass::program_name());
57 program = &ctx.
get_program(KernelClass::program_name());
65 return static_cast<cl_uint
>( ((length > 1) ? (cl_uint(length) << 2) : 0) + (reciprocal ? 2 : 0) + (flip_sign ? 1 : 0) );
74 if (B_row_major && C_row_major)
75 return "trans_mat_mult_row_row";
76 if (B_row_major && !C_row_major)
77 return "trans_mat_mult_row_col";
78 if (!B_row_major && C_row_major)
79 return "trans_mat_mult_col_row";
81 return "trans_mat_mult_col_col";
84 if (B_row_major && C_row_major)
85 return "mat_mult_row_row";
86 if (B_row_major && !C_row_major)
87 return "mat_mult_row_col";
88 if (!B_row_major && C_row_major)
89 return "mat_mult_col_row";
91 return "mat_mult_col_col";
96 template<
typename SomeT>
A tag class representing the cosh() function.
A tag class representing the tan() function.
Represents an OpenCL kernel within ViennaCL.
viennacl::ocl::program & get_program(std::string const &name)
Returns the program with the provided name.
std::string sparse_dense_matmult_kernel_name(bool B_transposed, bool B_row_major, bool C_row_major)
Returns the OpenCL kernel string for the operation C = A * B with A sparse, B, C dense matrices...
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
A tag class representing the modulus function for integers.
A tag class representing the ceil() function.
A class representing a compute device (e.g. a GPU)
This file provides the forward declarations for the main types used within ViennaCL.
ocl::kernel & legacy_kernel_for_matrix(matrix_base< NumericT > const &M, std::string const &kernel_name)
A tag class representing the log() function.
A tag class representing the tanh() function.
A tag class representing the fabs() function.
A tag class representing the atan() function.
A tag class representing the sinh() function.
A tag class representing the exp() function.
NumericT flip_sign(NumericT val)
cl_uint make_options(vcl_size_t length, bool reciprocal, bool flip_sign)
Main kernel class for generating OpenCL kernels for operations on/with dense matrix objects of type v...
ocl::device const & current_device(SomeT const &obj)
A tag class representing the sqrt() function.
Wrapper class for an OpenCL program.
A tag class representing the sin() function.
A tag class representing the floor() function.
A tag class representing the asin() function.
A tag class representing the acos() function.
viennacl::ocl::kernel & get_kernel(std::string const &name)
Returns the kernel with the provided name.
std::string op_to_string(op_abs)
A tag class representing the log10() function.
A tag class representing the cos() function.
Runtime generation of OpenCL kernels for matrix operations.