libidx
/home/rex/ebltrunk/core/libidx/include/thops.hpp
00001 /***************************************************************************
00002  *   Copyright (C) 2012 by Soumith Chintala *
00003  *   soumith@gmail.com *
00004  *   All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Redistribution under a license not approved by the Open Source
00014  *       Initiative (http://www.opensource.org) must display the
00015  *       following acknowledgement in all advertising material:
00016  *        This product includes software developed at the Courant
00017  *        Institute of Mathematical Sciences (http://cims.nyu.edu).
00018  *     * The names of the authors may not be used to endorse or promote products
00019  *       derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00023  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00024  * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY
00025  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00027  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00028  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  ***************************************************************************/
00032 
00033 #ifndef THOPS_HPP_
00034 #define THOPS_HPP_
00035 
00036 //#include "numerics.h"
00037 //#include "stl.h"
00038 
00039 #ifdef __TH__
00040 #include "idx.h"
00041 
00042 namespace ebl {
00043 
00044   template <typename T>
00045   void th_add(idx<T> &in, idx<T> &out) {
00046     eblerror("th_add in-place : type not available for TH. Available types are float32, float64");
00047   }
00048 
00049 
00050   template <typename T>
00051   void th_add(idx<T> &in, idx<T> &in2, idx<T> &out) {
00052     eblerror("th_add not-in-place : type not available for TH. Available types are float32, float64");
00053   }
00054 
00055   template <typename T>
00056   void th_copy(idx<T> &in, idx<T> &out) {
00057     eblerror("th_copy not-in-place : type not available for TH. Available types are float32, float64");
00058   }
00059 
00060   template <typename T>
00061   void th_convolution(idx<T> &in, idx<T> &ker, idx<T> &out, intg stride_x, intg stride_y) {
00062     eblerror("th_convolution : type not available for TH. Available types are float32, float64");
00063   }
00064 
00065   template <typename T>
00066   void th_convolution_3d(idx<T> &in, idx<T> &ker, idx<T> &out) {
00067     eblerror("th_convolution_3d : type not available for TH. Available types are float32, float64");
00068   }
00069 
00070   template <typename T>
00071   void th_convolution_3dmap(idx<T> &in, idx<T> &ker, idx<T> &out,
00072                             idx<intg> &table,
00073                             intg stride_x, intg stride_y) {
00074     eblerror("th_convolution_3dmap : type not available for TH. Available types are float32, float64");
00075   }
00076 
00077   template <typename T>
00078   void th_convolution_3dmap_bprop(idx<T> &inx, idx<T> &kerx,
00079                                   idx<T> &outdx, idx<T> &indx, 
00080                                   idx<T> &kerdx, idx<intg> &table,
00081                                   intg stride_w, intg stride_h) {
00082     eblerror("th_convolution_3dmap_bprop : type not available for TH. Available types are float32, float64");
00083   }
00084 
00085   template <typename T>
00086   void th_tanh(idx<T> &in, idx<T> &out) {
00087     eblerror("th_tanh : type not available for TH. Available types are float32, float64");
00088   }
00089 
00090 
00091   template <typename T>
00092   void th_pow(idx<T> &in, idx<T> &out, T p) {
00093     eblerror("th_pow : type not available for TH. Available types are float32, float64");
00094   }
00095 
00096   template <typename T>
00097   void th_maxpool_3d(idx<T> &in, intg kernel_w, intg kernel_h, idx<T> &out,
00098                             intg stride_x, intg stride_y, idx<T> &indices_e) {
00099     eblerror("th_maxpool_3d : type not available for TH. Available types are float32, float64");
00100   }
00101 
00102   template <typename T>
00103   void th_maxpool_3d_bprop(idx<T> &inx, intg kernel_w, intg kernel_h,
00104                                   idx<T> &outdx, idx<T> &indx, 
00105                                   intg stride_w, intg stride_h, idx<T> &indices_e) {
00106     eblerror("th_maxpool_3d_bprop : type not available for TH. Available types are float32, float64");
00107   }
00108 
00109 
00110 }
00111 #endif /* __TH__ */
00112 
00113 #endif /* THOPS_HPP_ */