aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-06-28 10:25:35 +0100
committerViet-Hoa Do <viet-hoa.do@arm.com>2023-06-28 10:44:20 +0000
commite1880f0a0095d73a5478289bbfb9b9ab0d598d6e (patch)
treeaef8be975f7e71c735017a172edaa04884cc536d
parentbd4f6b9ed37ed7a222e36ce6823ba96396f60deb (diff)
downloadComputeLibrary-e1880f0a0095d73a5478289bbfb9b9ab0d598d6e.tar.gz
Fix compute kernel writer build warnings
Partially resolves: COMPMID-6283 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I40cdbfd30abca2016f4caaa41a24350d1ff35c4c Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9830 Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--compute_kernel_writer/include/ckw/KernelWriter.h2
-rw-r--r--compute_kernel_writer/src/KernelWriter.cpp4
-rw-r--r--compute_kernel_writer/src/Prototype.h33
3 files changed, 32 insertions, 7 deletions
diff --git a/compute_kernel_writer/include/ckw/KernelWriter.h b/compute_kernel_writer/include/ckw/KernelWriter.h
index 99244fb1a9..5dce62a14c 100644
--- a/compute_kernel_writer/include/ckw/KernelWriter.h
+++ b/compute_kernel_writer/include/ckw/KernelWriter.h
@@ -38,7 +38,7 @@ namespace ckw
namespace prototype
{
-class GpuKernelWriterAttribute;
+struct GpuKernelWriterAttribute;
class IGpuKernelWriter;
} // namespace prototype
diff --git a/compute_kernel_writer/src/KernelWriter.cpp b/compute_kernel_writer/src/KernelWriter.cpp
index 28538e7893..5d79985e87 100644
--- a/compute_kernel_writer/src/KernelWriter.cpp
+++ b/compute_kernel_writer/src/KernelWriter.cpp
@@ -139,7 +139,7 @@ void KernelWriter::register_operand(OperandBase *operand, bool declaring)
void KernelWriter::op_load(TileOperand &tile, TensorOperand &tensor, const TensorTileSampler &sampler)
{
- auto impl_tensor = prototype::TensorOperand(
+ prototype::TensorOperand impl_tensor(
tensor.name(),
prototype::GpuSampler{
sampler.format(),
@@ -160,7 +160,7 @@ void KernelWriter::op_load(TileOperand &tile, TensorOperand &tensor, const Tenso
void KernelWriter::op_store(TensorOperand &tensor, const TileOperand &tile, const TensorTileSampler &sampler)
{
- auto impl_tensor = prototype::TensorOperand(
+ prototype::TensorOperand impl_tensor(
tensor.name(),
prototype::GpuSampler{
sampler.format(),
diff --git a/compute_kernel_writer/src/Prototype.h b/compute_kernel_writer/src/Prototype.h
index f113a0bfbc..45f1b3d464 100644
--- a/compute_kernel_writer/src/Prototype.h
+++ b/compute_kernel_writer/src/Prototype.h
@@ -112,6 +112,7 @@ inline std::string data_type_to_cl_type(DataType dt)
return "bool";
default:
assert(false);
+ return "";
}
}
@@ -143,6 +144,7 @@ inline int32_t width_to_cl_vector_size(int32_t width)
return 16;
default:
assert(false);
+ return 0;
}
}
@@ -410,8 +412,9 @@ private:
case 15:
return "F";
default:
- std::cout << "Unsupported hexadecimal value" << std::endl;
- assert(false);
+ std::cout << "Unsupported hexadecimal value" << std::endl;
+ assert(false);
+ return "";
}
}
};
@@ -766,6 +769,7 @@ public:
default:
std::cout << "Unsupported storage" << std::endl;
assert(false);
+ return "";
}
};
@@ -1474,9 +1478,9 @@ inline std::string to_string(AssignmentOp op)
return "-=";
case AssignmentOp::Increment:
return "+=";
-
default:
assert(false);
+ return "";
}
}
@@ -1512,6 +1516,7 @@ inline std::string to_string(BinaryOp op)
return "!";
default:
assert(false);
+ return "";
}
}
@@ -1541,6 +1546,7 @@ inline std::string binary_op_string(BinaryOp op)
return "lte";
default:
assert(false);
+ return "";
}
}
@@ -1673,6 +1679,8 @@ struct GpuSampler
inline GpuSampler create_simple_sampler(const TensorInfo* tensor_info_id, GpuSampler sampler, int32_t step_x, int32_t step_y, int32_t step_z)
{
+ CKW_UNUSED(step_x, step_y, step_z);
+
auto tensor = tensor_info_id->shape;
GpuSampler dst_sampler;
@@ -2020,6 +2028,7 @@ private:
return TensorComponent::OffsetFirstElement;
default:
assert(false);
+ return TensorComponent::Unknown;
}
}
@@ -2123,7 +2132,7 @@ inline std::string generate_code(GpuKernelWriterDataHolder &in, const std::strin
code += "}\n";
return code;
-};
+}
/**
* @brief This class is responsible to map a N-Tensor to a 3d tensor. The mapper needs the GpuSampler to know
@@ -2148,6 +2157,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2163,6 +2173,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2178,6 +2189,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2192,6 +2204,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2207,6 +2220,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2221,6 +2235,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2236,6 +2251,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2252,6 +2268,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2268,6 +2285,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2283,6 +2301,7 @@ public:
default:
std::cout << "Unsupported tensor format" << std::endl;
assert(false);
+ return "";
}
}
@@ -2783,6 +2802,7 @@ private:
default:
std::cout << "Unsupported GpuLoadStoreType" << std::endl;
assert(false);
+ return "";
}
}
@@ -3002,6 +3022,7 @@ private:
assert(false);
std::cout << "Unsupported GpuLoadStoreType" << std::endl;
assert(false);
+ return "";
}
}
@@ -3027,6 +3048,7 @@ private:
default:
std::cout << "Unsupported address_mode_coord" << std::endl;
assert(false);
+ return "";
}
}
@@ -3085,6 +3107,7 @@ public:
default:
std::cout << "Unsupported Gpu tensor storage" << std::endl;
assert(false);
+ return nullptr;
}
}
};
@@ -3470,6 +3493,7 @@ public:
const int32_t dst_h = var->format().h;
// It must be a scalar variable
+ CKW_UNUSED(dst_w, dst_h);
assert(dst_w == 1);
assert(dst_h == 1);
@@ -3705,6 +3729,7 @@ public:
default:
std::cout << "Unsupported Gpu programming language" << std::endl;
assert(false);
+ return nullptr;
}
}
};