Merge pull request #45939 from oskarflordal:master
PiperOrigin-RevId: 350342745 Change-Id: Icf6a025d944aeaf977f5d9867d462c2e2ef2ee66
This commit is contained in:
commit
677c530a46
@ -236,7 +236,8 @@ std::string GenerateDepthwiseConvolutionCode(
|
||||
GPUOperation CreateDepthwiseConvolution2D(
|
||||
const GpuInfo& gpu_info, const OperationDef& definition,
|
||||
const DepthwiseConvolution2DAttributes& attr) {
|
||||
bool weights_are_buffer = gpu_info.IsMali();
|
||||
bool weights_are_buffer =
|
||||
!gpu_info.SupportsImageBuffer() || gpu_info.IsMali();
|
||||
GPUOperation op(definition);
|
||||
op.args_.AddInt("kernel_size_x", attr.weights.shape.w);
|
||||
op.args_.AddInt("stride_x", attr.strides.w);
|
||||
|
@ -312,7 +312,8 @@ bool IsDepthwiseConv3x3Supported(const DepthwiseConvolution2DAttributes& attr) {
|
||||
DepthwiseConv3x3 CreateDepthwiseConv3x3(
|
||||
const GpuInfo& gpu_info, const OperationDef& definition,
|
||||
const DepthwiseConvolution2DAttributes& attr) {
|
||||
bool weights_are_buffer = gpu_info.IsPowerVR() || gpu_info.IsMali();
|
||||
bool weights_are_buffer = !gpu_info.SupportsImageBuffer() ||
|
||||
gpu_info.IsPowerVR() || gpu_info.IsMali();
|
||||
bool local_mem_uploads = weights_are_buffer && gpu_info.IsPowerVR();
|
||||
DepthwiseConv3x3 result(definition, weights_are_buffer, local_mem_uploads,
|
||||
gpu_info);
|
||||
|
@ -155,7 +155,9 @@ FullyConnected CreateFullyConnected(const GpuInfo& gpu_info,
|
||||
result.UploadWeights(attr.weights, UseBufferForWeights(gpu_info));
|
||||
|
||||
TensorLinearDescriptor desc;
|
||||
desc.storage_type = LinearStorageType::TEXTURE_2D;
|
||||
desc.storage_type = gpu_info.SupportsImageBuffer()
|
||||
? LinearStorageType::TEXTURE_2D
|
||||
: LinearStorageType::BUFFER;
|
||||
desc.element_type = definition.GetDataType();
|
||||
desc.UploadLinearData(attr.bias);
|
||||
result.args_.AddObject(
|
||||
|
Loading…
Reference in New Issue
Block a user