diff --git a/src/operator/ConvImpl.cpp b/src/operator/ConvImpl.cpp
index 17877ab1d5f15dadf85af77777f477e89df39747..515f5f19d7702ea5bc037b672e182e97800a703b 100644
--- a/src/operator/ConvImpl.cpp
+++ b/src/operator/ConvImpl.cpp
@@ -30,7 +30,7 @@ void Aidge::ConvImpl_cuda<DIM>::forward() {
 
     // Lazy-initialize CuDNN convolution descriptor
     if (mConvDesc == nullptr) {
-        const Conv_Op& convOp = static_cast<const Conv_Op&>(mOp);
+        const Conv_Op<DIM>& convOp = static_cast<const Conv_Op<DIM>&>(mOp);
         const std::vector<int> strides(convOp.template getAttr<ConvAttr::StrideDims>().begin(), convOp.template getAttr<ConvAttr::StrideDims>().end());
         const std::vector<int> paddings(DIM, 0);
         const std::vector<int> upscales(convOp.template getAttr<ConvAttr::DilationDims>().begin(), convOp.template getAttr<ConvAttr::DilationDims>().end());