Merge pull request #36673 from wdirons:fix_gpu_test_in_configure

PiperOrigin-RevId: 302039094
Change-Id: Ie5980e0a8feda85bd6803bd316e5a59793891515
This commit is contained in:
TensorFlower Gardener 2020-03-20 09:28:07 -07:00
commit 2fa7369fe9

View File

@ -1155,7 +1155,7 @@ def set_trisycl_include_dir(environ_cp):
write_action_env_to_bazelrc('TRISYCL_INCLUDE_DIR', trisycl_include_dir) write_action_env_to_bazelrc('TRISYCL_INCLUDE_DIR', trisycl_include_dir)
def system_specific_test_config(env): def system_specific_test_config(environ_cp):
"""Add default build and test flags required for TF tests to bazelrc.""" """Add default build and test flags required for TF tests to bazelrc."""
write_to_bazelrc('test --flaky_test_attempts=3') write_to_bazelrc('test --flaky_test_attempts=3')
write_to_bazelrc('test --test_size_filters=small,medium') write_to_bazelrc('test --test_size_filters=small,medium')
@ -1171,14 +1171,14 @@ def system_specific_test_config(env):
test_only_filters = ['-oss_serial'] test_only_filters = ['-oss_serial']
if is_windows(): if is_windows():
test_and_build_filters.append('-no_windows') test_and_build_filters.append('-no_windows')
if env.get('TF_NEED_CUDA', None) == '1': if environ_cp.get('TF_NEED_CUDA', None) == '1':
test_and_build_filters += ['-no_windows_gpu', '-no_gpu'] test_and_build_filters += ['-no_windows_gpu', '-no_gpu']
else: else:
test_and_build_filters.append('-gpu') test_and_build_filters.append('-gpu')
elif is_macos(): elif is_macos():
test_and_build_filters += ['-gpu', '-nomac', '-no_mac'] test_and_build_filters += ['-gpu', '-nomac', '-no_mac']
elif is_linux(): elif is_linux():
if env.get('TF_NEED_CUDA', None) == '1': if environ_cp.get('TF_NEED_CUDA', None) == '1':
test_and_build_filters.append('-no_gpu') test_and_build_filters.append('-no_gpu')
write_to_bazelrc('test --test_env=LD_LIBRARY_PATH') write_to_bazelrc('test --test_env=LD_LIBRARY_PATH')
else: else:
@ -1522,7 +1522,7 @@ def main():
create_android_ndk_rule(environ_cp) create_android_ndk_rule(environ_cp)
create_android_sdk_rule(environ_cp) create_android_sdk_rule(environ_cp)
system_specific_test_config(os.environ) system_specific_test_config(environ_cp)
set_action_env_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False) set_action_env_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False)
if environ_cp.get('TF_CONFIGURE_IOS') == '1': if environ_cp.get('TF_CONFIGURE_IOS') == '1':