Make halide_validate_dev_pointer interface generic