diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp
index 5b225d3cd08d9711c5d25de73565eafc106fccdd..d61f3d546afec16532f06c6f6bd751f87a780584 100644
--- a/src/wrap_cl.hpp
+++ b/src/wrap_cl.hpp
@@ -5893,9 +5893,9 @@ namespace pyopencl
 
     int ary_flags = 0;
     if (order == NPY_FORTRANORDER)
-      ary_flags |= NPY_FARRAY;
+      ary_flags |= NPY_ARRAY_FARRAY;
     else if (order == NPY_CORDER)
-      ary_flags |= NPY_CARRAY;
+      ary_flags |= NPY_ARRAY_CARRAY;
     else
       throw std::runtime_error("unrecognized order specifier");
 
diff --git a/src/wrap_helpers.hpp b/src/wrap_helpers.hpp
index 36774953593f4f5bd81f91df5844c4b5d668bc6d..041065930977e407decf26329cc034a688cd451c 100644
--- a/src/wrap_helpers.hpp
+++ b/src/wrap_helpers.hpp
@@ -142,9 +142,9 @@ namespace py = nanobind;
     \
     int ary_flags = 0; \
     if (order == NPY_FORTRANORDER) \
-      ary_flags |= NPY_FARRAY; \
+      ary_flags |= NPY_ARRAY_FARRAY; \
     else if (order == NPY_CORDER) \
-      ary_flags |= NPY_CARRAY; \
+      ary_flags |= NPY_ARRAY_CARRAY; \
     else \
       throw std::runtime_error("unrecognized order specifier"); \
     \