提交 9315073f 编写于 作者: Y Yanzhan Yang 提交者: GitHub

enable all mps conv layer (#1592)

上级 be3cdaaf
......@@ -135,9 +135,17 @@ public class Texture: Tensorial {
}
if computePrecision == .Float16 {
tmpTextureDes.pixelFormat = .rgba16Float
if tensorDim[1] == 1 {
tmpTextureDes.pixelFormat = .r16Float
} else {
tmpTextureDes.pixelFormat = .rgba16Float
}
} else if computePrecision == .Float32 {
tmpTextureDes.pixelFormat = .rgba32Float
if tensorDim[1] == 1 {
tmpTextureDes.pixelFormat = .r32Float
} else {
tmpTextureDes.pixelFormat = .rgba32Float
}
}
tmpTextureDes.usage = [.shaderRead, .shaderWrite]
......
......@@ -111,10 +111,7 @@ class ConvAddKernel<P: PrecisionProtocol>: Kernel, Computable {
var shouldUseMPS = false
if #available(iOS 11.0, *), initContext.useMPS {
// 输入输出 tensor channel 必须都大于 4
if param.input.tensorDim[1] > 4 && param.output.tensorDim[1] > 4 {
shouldUseMPS = true
}
shouldUseMPS = true
}
if shouldUseMPS {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册