diff --git a/loopy/compiled.py b/loopy/compiled.py
index 3f553357c5884d51dde4f12af2d77d0b07bc8d49..c449d1850626f4745048f0fe4efc8e79e9a8e0f6 100644
--- a/loopy/compiled.py
+++ b/loopy/compiled.py
@@ -176,7 +176,7 @@ def make_ref_args(kernel, queue, parameters,
                     raise RuntimeError("write-mode images not supported in "
                             "automatic testing")
 
-                if isinstance(arg.dtype, np.number):
+                if arg.dtype.isbuiltin:
                     ary.fill(fill_value)
                 else:
                     from warnings import warn
@@ -232,7 +232,7 @@ def make_args(queue, kernel, ref_input_arrays, parameters,
                 shape = evaluate(arg.shape, parameters)
                 ary = cl_array.empty(queue, shape, arg.dtype, order=arg.order)
 
-                if isinstance(arg.dtype, np.number):
+                if arg.dtype.isbuiltin:
                     ary.fill(fill_value)
                 else:
                     from warnings import warn