You could use is_child_theme()
in the parent theme's functions.php
file:
if ( ! is_child_theme() ) {
require( 'path/to/ads/file.php' );
}
Update
If you don't want to edit the parent theme -- for instance, so that any updates to the parent theme won't overwrite what you've done -- you could do something like this in the child theme's functions.php
file:
global $ads_class; // whatever your ads class is named
if (
is_child_theme() &&
(
class_exists( 'Ads_Class' ) &&
'Ads_Class' == get_class( $ads_class)
)
) {
$ads_class->__destruct();
}