github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/blas/gonum/single_precision.bash (about)

     1  #!/usr/bin/env bash
     2  
     3  # Copyright ©2015 The Gonum Authors. All rights reserved.
     4  # Use of this source code is governed by a BSD-style
     5  # license that can be found in the LICENSE file.
     6  
     7  WARNINGF32='//\
     8  // Float32 implementations are autogenerated and not directly tested.\
     9  '
    10  WARNINGC64='//\
    11  // Complex64 implementations are autogenerated and not directly tested.\
    12  '
    13  
    14  # Level1 routines.
    15  
    16  echo Generating level1float32.go
    17  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32.go
    18  cat level1float64.go \
    19  | gofmt -r 'blas.Float64Level1 -> blas.Float32Level1' \
    20  \
    21  | gofmt -r 'float64 -> float32' \
    22  | gofmt -r 'blas.DrotmParams -> blas.SrotmParams' \
    23  \
    24  | gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \
    25  | gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \
    26  | gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \
    27  | gofmt -r 'f64.L2NormInc -> f32.L2NormInc' \
    28  | gofmt -r 'f64.L2NormUnitary -> f32.L2NormUnitary' \
    29  | gofmt -r 'f64.ScalInc -> f32.ScalInc' \
    30  | gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \
    31  \
    32  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \
    33        -e 's_^// D_// S_' \
    34        -e "s_^\(func (Implementation) \)Id\(.*\)\$_$WARNINGF32\1Is\2_" \
    35        -e 's_^// Id_// Is_' \
    36        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
    37        -e 's_"math"_math "github.com/jingcheng-WU/gonum/internal/math32"_' \
    38  >> level1float32.go
    39  
    40  echo Generating level1cmplx64.go
    41  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level1cmplx64.go
    42  cat level1cmplx128.go \
    43  | gofmt -r 'blas.Complex128Level1 -> blas.Complex64Level1' \
    44  \
    45  | gofmt -r 'float64 -> float32' \
    46  | gofmt -r 'complex128 -> complex64' \
    47  \
    48  | gofmt -r 'c128.AxpyInc -> c64.AxpyInc' \
    49  | gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \
    50  | gofmt -r 'c128.DotcInc -> c64.DotcInc' \
    51  | gofmt -r 'c128.DotcUnitary -> c64.DotcUnitary' \
    52  | gofmt -r 'c128.DotuInc -> c64.DotuInc' \
    53  | gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \
    54  | gofmt -r 'c128.ScalInc -> c64.ScalInc' \
    55  | gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \
    56  | gofmt -r 'dcabs1 -> scabs1' \
    57  \
    58  | sed -e "s_^\(func (Implementation) \)Zdot\(.*\)\$_$WARNINGC64\1Cdot\2_" \
    59        -e 's_^// Zdot_// Cdot_' \
    60        -e "s_^\(func (Implementation) \)Zdscal\(.*\)\$_$WARNINGC64\1Csscal\2_" \
    61        -e 's_^// Zdscal_// Csscal_' \
    62        -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \
    63        -e 's_^// Z_// C_' \
    64        -e "s_^\(func (Implementation) \)Iz\(.*\)\$_$WARNINGC64\1Ic\2_" \
    65        -e 's_^// Iz_// Ic_' \
    66        -e "s_^\(func (Implementation) \)Dz\(.*\)\$_$WARNINGC64\1Sc\2_" \
    67        -e 's_^// Dz_// Sc_' \
    68        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/c128"_"github.com/jingcheng-WU/gonum/internal/asm/c64"_' \
    69        -e 's_"math"_math "github.com/jingcheng-WU/gonum/internal/math32"_' \
    70  >> level1cmplx64.go
    71  
    72  echo Generating level1float32_sdot.go
    73  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_sdot.go
    74  cat level1float64_ddot.go \
    75  | gofmt -r 'float64 -> float32' \
    76  \
    77  | gofmt -r 'f64.DotInc -> f32.DotInc' \
    78  | gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \
    79  \
    80  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \
    81        -e 's_^// D_// S_' \
    82        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
    83  >> level1float32_sdot.go
    84  
    85  echo Generating level1float32_dsdot.go
    86  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_dsdot.go
    87  cat level1float64_ddot.go \
    88  | gofmt -r '[]float64 -> []float32' \
    89  \
    90  | gofmt -r 'f64.DotInc -> f32.DdotInc' \
    91  | gofmt -r 'f64.DotUnitary -> f32.DdotUnitary' \
    92  \
    93  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1Ds\2_" \
    94        -e 's_^// D_// Ds_' \
    95        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
    96  >> level1float32_dsdot.go
    97  
    98  echo Generating level1float32_sdsdot.go
    99  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_sdsdot.go
   100  cat level1float64_ddot.go \
   101  | gofmt -r 'float64 -> float32' \
   102  \
   103  | gofmt -r 'f64.DotInc(x, y, f(n), f(incX), f(incY), f(ix), f(iy)) -> alpha + float32(f32.DdotInc(x, y, f(n), f(incX), f(incY), f(ix), f(iy)))' \
   104  | gofmt -r 'f64.DotUnitary(a, b) -> alpha + float32(f32.DdotUnitary(a, b))' \
   105  \
   106  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1Sds\2_" \
   107        -e 's_^// D\(.*\)$_// Sds\1 plus a constant_' \
   108        -e 's_\\sum_alpha + \\sum_' \
   109        -e 's/n int/n int, alpha float32/' \
   110        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
   111  >> level1float32_sdsdot.go
   112  
   113  
   114  # Level2 routines.
   115  
   116  echo Generating level2float32.go
   117  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level2float32.go
   118  cat level2float64.go \
   119  | gofmt -r 'blas.Float64Level2 -> blas.Float32Level2' \
   120  \
   121  | gofmt -r 'float64 -> float32' \
   122  \
   123  | gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \
   124  | gofmt -r 'f64.AxpyIncTo -> f32.AxpyIncTo' \
   125  | gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \
   126  | gofmt -r 'f64.AxpyUnitaryTo -> f32.AxpyUnitaryTo' \
   127  | gofmt -r 'f64.DotInc -> f32.DotInc' \
   128  | gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \
   129  | gofmt -r 'f64.ScalInc -> f32.ScalInc' \
   130  | gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \
   131  | gofmt -r 'f64.Ger -> f32.Ger' \
   132  \
   133  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \
   134        -e 's_^// D_// S_' \
   135        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
   136  >> level2float32.go
   137  
   138  echo Generating level2cmplx64.go
   139  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level2cmplx64.go
   140  cat level2cmplx128.go \
   141  | gofmt -r 'blas.Complex128Level2 -> blas.Complex64Level2' \
   142  \
   143  | gofmt -r 'complex128 -> complex64' \
   144  | gofmt -r 'float64 -> float32' \
   145  \
   146  | gofmt -r 'c128.AxpyInc -> c64.AxpyInc' \
   147  | gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \
   148  | gofmt -r 'c128.DotuInc -> c64.DotuInc' \
   149  | gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \
   150  | gofmt -r 'c128.ScalInc -> c64.ScalInc' \
   151  | gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \
   152  \
   153  | sed -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \
   154        -e 's_^// Z_// C_' \
   155        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/c128"_"github.com/jingcheng-WU/gonum/internal/asm/c64"_' \
   156        -e 's_"math/cmplx"_cmplx "github.com/jingcheng-WU/gonum/internal/cmplx64"_' \
   157  >> level2cmplx64.go
   158  
   159  # Level3 routines.
   160  
   161  echo Generating level3float32.go
   162  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level3float32.go
   163  cat level3float64.go \
   164  | gofmt -r 'blas.Float64Level3 -> blas.Float32Level3' \
   165  \
   166  | gofmt -r 'float64 -> float32' \
   167  \
   168  | gofmt -r 'f64.AxpyUnitaryTo -> f32.AxpyUnitaryTo' \
   169  | gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \
   170  | gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \
   171  | gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \
   172  \
   173  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \
   174        -e 's_^// D_// S_' \
   175        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
   176  >> level3float32.go
   177  
   178  echo Generating sgemm.go
   179  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > sgemm.go
   180  cat dgemm.go \
   181  | gofmt -r 'float64 -> float32' \
   182  | gofmt -r 'sliceView64 -> sliceView32' \
   183  \
   184  | gofmt -r 'dgemmParallel -> sgemmParallel' \
   185  | gofmt -r 'computeNumBlocks64 -> computeNumBlocks32' \
   186  | gofmt -r 'dgemmSerial -> sgemmSerial' \
   187  | gofmt -r 'dgemmSerialNotNot -> sgemmSerialNotNot' \
   188  | gofmt -r 'dgemmSerialTransNot -> sgemmSerialTransNot' \
   189  | gofmt -r 'dgemmSerialNotTrans -> sgemmSerialNotTrans' \
   190  | gofmt -r 'dgemmSerialTransTrans -> sgemmSerialTransTrans' \
   191  \
   192  | gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \
   193  | gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \
   194  | gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \
   195  \
   196  | sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \
   197        -e 's_^// D_// S_' \
   198        -e 's_^// d_// s_' \
   199        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/f64"_"github.com/jingcheng-WU/gonum/internal/asm/f32"_' \
   200  >> sgemm.go
   201  
   202  echo Generating level3cmplx64.go
   203  echo -e '// Code generated by "go generate github.com/jingcheng-WU/gonum/blas/gonum”; DO NOT EDIT.\n' > level3cmplx64.go
   204  cat level3cmplx128.go \
   205  | gofmt -r 'blas.Complex128Level3 -> blas.Complex64Level3' \
   206  \
   207  | gofmt -r 'float64 -> float32' \
   208  | gofmt -r 'complex128 -> complex64' \
   209  \
   210  | gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \
   211  | gofmt -r 'c128.DscalUnitary -> c64.SscalUnitary' \
   212  | gofmt -r 'c128.DotcUnitary -> c64.DotcUnitary' \
   213  | gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \
   214  | gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \
   215  \
   216  | sed -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \
   217        -e 's_^// Z_// C_' \
   218        -e 's_"github.com/jingcheng-WU/gonum/internal/asm/c128"_"github.com/jingcheng-WU/gonum/internal/asm/c64"_' \
   219        -e 's_"math/cmplx"_cmplx "github.com/jingcheng-WU/gonum/internal/cmplx64"_' \
   220  >> level3cmplx64.go