forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
native.go
66 lines (53 loc) · 1.56 KB
/
native.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright ©2015 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:generate ./single_precision
package native
type Implementation struct{}
// The following are panic strings used during parameter checks.
const (
negativeN = "blas: n < 0"
zeroIncX = "blas: zero x index increment"
zeroIncY = "blas: zero y index increment"
badLenX = "blas: x index out of range"
badLenY = "blas: y index out of range"
mLT0 = "blas: m < 0"
nLT0 = "blas: n < 0"
kLT0 = "blas: k < 0"
kLLT0 = "blas: kL < 0"
kULT0 = "blas: kU < 0"
badUplo = "blas: illegal triangle"
badTranspose = "blas: illegal transpose"
badDiag = "blas: illegal diagonal"
badSide = "blas: illegal side"
badLdA = "blas: index of a out of range"
badLdB = "blas: index of b out of range"
badLdC = "blas: index of c out of range"
badX = "blas: x index out of range"
badY = "blas: y index out of range"
)
// [SD]gemm behavior constants. These are kept here to keep them out of the
// way during single precision code genration.
const (
blockSize = 64 // b x b matrix
minParBlock = 4 // minimum number of blocks needed to go parallel
buffMul = 4 // how big is the buffer relative to the number of workers
)
// [SD]gemm debugging constant.
const debug = false
// subMul is a common type shared by [SD]gemm.
type subMul struct {
i, j int // index of block
}
func max(a, b int) int {
if a > b {
return a
}
return b
}
func min(a, b int) int {
if a > b {
return b
}
return a
}