Lunderberg commented on code in PR #16571:
URL: https://github.com/apache/tvm/pull/16571#discussion_r1489761217
##########
src/target/source/codegen_webgpu.h:
##########
@@ -40,14 +40,15 @@ namespace codegen {
* \brief WebGPU code generator.
*
* Note WGSL have a different syntax from normal C.
- * We only leevrage the C for expression generation and
+ * We only leverage the C for expression generation and
* write most of the language generations.
*/
class CodeGenWebGPU final : public CodeGenC {
public:
explicit CodeGenWebGPU(Target target);
// overrides
std::string Finish() final;
+ using CodeGenC::AddFunction;
Review Comment:
My main concern is because `CodeGenC::AddFunction` is a virtual function.
The `CodeGenWebGPU::AddFunction` shadows `CodeGenC::AddFunction`, but doesn't
override it due to the different signature. Calls made to this function
through a base class pointer `CodegenC* my_codegen = get_codegen();
my_codegen->AddFunction(...)` would therefore call `CodeGenC::AddFunction` not
`CodeGenWebGPU::AddFunction`.
I don't think there are any calls to `AddFunction` through a base class
pointer, but its something that could cause unexpected breakage in the future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]