diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp
index c11a88f2732b87d3196a5dab55fe7e6c4d478272..4b40e85b922883a0699e4d0ca4ff57baf3784596 100644
--- a/src/wrap_constants.cpp
+++ b/src/wrap_constants.cpp
@@ -503,7 +503,9 @@ void pyopencl_expose_constants(py::module &m)
 
   {
     py::class_<device_topology_type_amd> cls(m, "device_topology_type_amd");
+#ifdef CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD
     cls.attr("PCIE") = CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD;
+#endif
   }
 
   {