ViennaCL - The Vienna Computing Library
1.5.0
|
00001 #ifndef VIENNACL_RAND_UTILS_HPP_ 00002 #define VIENNACL_RAND_UTILS_HPP_ 00003 00004 /* ========================================================================= 00005 Copyright (c) 2010-2013, Institute for Microelectronics, 00006 Institute for Analysis and Scientific Computing, 00007 TU Wien. 00008 Portions of this software are copyright by UChicago Argonne, LLC. 00009 00010 ----------------- 00011 ViennaCL - The Vienna Computing Library 00012 ----------------- 00013 00014 Project Head: Karl Rupp rupp@iue.tuwien.ac.at 00015 00016 (A list of authors and contributors can be found in the PDF manual) 00017 00018 License: MIT (X11), see file LICENSE in the base directory 00019 ============================================================================= */ 00025 #ifdef VIENNACL_WITH_OPENCL 00026 #include "viennacl/linalg/kernels/rand_kernels.h" 00027 00028 namespace viennacl{ 00029 00030 namespace rand{ 00031 00032 00033 template<class SCALARTYPE, class DISTRIBUTION> 00034 struct random_matrix_t{ 00035 typedef size_t size_type; 00036 random_matrix_t(size_type _size1, unsigned int _size2, DISTRIBUTION const & _distribution) : size1(_size1), size2(_size2), distribution(_distribution){ 00037 #ifdef VIENNACL_WITH_OPENCL 00038 viennacl::linalg::kernels::rand<SCALARTYPE,1>::init(); 00039 #endif 00040 } 00041 size_type size1; 00042 size_type size2; 00043 DISTRIBUTION distribution; 00044 }; 00045 00046 00047 template<class SCALARTYPE, class DISTRIBUTION> 00048 struct random_vector_t{ 00049 typedef size_t size_type; 00050 random_vector_t(size_type _size, DISTRIBUTION const & _distribution) : size(_size), distribution(_distribution){ 00051 #ifdef VIENNACL_WITH_OPENCL 00052 viennacl::linalg::kernels::rand<SCALARTYPE,1>::init(); 00053 #endif 00054 } 00055 size_type size; 00056 DISTRIBUTION distribution; 00057 }; 00058 00059 template<class ScalarType, class Distribution> 00060 struct buffer_dumper; 00061 00062 00063 } 00064 00065 } 00066 00067 #endif 00068 00071 #endif