Using SupportsImages method instead of SupportsImageBuffer.
PiperOrigin-RevId: 350486382 Change-Id: I0f36b2c86ef55080a848016a09144c170f1cc2f5
This commit is contained in:
parent
95569ba915
commit
d1fe15249d
@ -236,8 +236,7 @@ std::string GenerateDepthwiseConvolutionCode(
|
||||
GPUOperation CreateDepthwiseConvolution2D(
|
||||
const GpuInfo& gpu_info, const OperationDef& definition,
|
||||
const DepthwiseConvolution2DAttributes& attr) {
|
||||
bool weights_are_buffer =
|
||||
!gpu_info.SupportsImageBuffer() || gpu_info.IsMali();
|
||||
bool weights_are_buffer = !gpu_info.SupportsImages() || gpu_info.IsMali();
|
||||
GPUOperation op(definition);
|
||||
op.args_.AddInt("kernel_size_x", attr.weights.shape.w);
|
||||
op.args_.AddInt("stride_x", attr.strides.w);
|
||||
@ -298,7 +297,7 @@ GPUOperation CreateDepthwiseConvolution2DDynamicWeights(
|
||||
GPUOperation CreateDepthwiseConvolution3D(
|
||||
const GpuInfo& gpu_info, const OperationDef& definition,
|
||||
const DepthwiseConvolution3DAttributes& attr) {
|
||||
bool weights_are_buffer = gpu_info.IsMali();
|
||||
bool weights_are_buffer = !gpu_info.SupportsImages() || 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,8 +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.SupportsImageBuffer() ||
|
||||
gpu_info.IsPowerVR() || gpu_info.IsMali();
|
||||
bool weights_are_buffer =
|
||||
!gpu_info.SupportsImages() || 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,9 +155,8 @@ FullyConnected CreateFullyConnected(const GpuInfo& gpu_info,
|
||||
result.UploadWeights(attr.weights, UseBufferForWeights(gpu_info));
|
||||
|
||||
TensorLinearDescriptor desc;
|
||||
desc.storage_type = gpu_info.SupportsImageBuffer()
|
||||
? LinearStorageType::TEXTURE_2D
|
||||
: LinearStorageType::BUFFER;
|
||||
desc.storage_type = gpu_info.SupportsImages() ? 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