Set COMPUTECPP_TOOLKIT_PATH.
(environ_cp)
| 1088 | |
| 1089 | |
| 1090 | def set_computecpp_toolkit_path(environ_cp): |
| 1091 | """Set COMPUTECPP_TOOLKIT_PATH.""" |
| 1092 | |
| 1093 | def toolkit_exists(toolkit_path): |
| 1094 | """Check if a computecpp toolkit path is valid.""" |
| 1095 | if is_linux(): |
| 1096 | sycl_rt_lib_path = 'lib/libComputeCpp.so' |
| 1097 | else: |
| 1098 | sycl_rt_lib_path = '' |
| 1099 | |
| 1100 | sycl_rt_lib_path_full = os.path.join(toolkit_path, sycl_rt_lib_path) |
| 1101 | exists = os.path.exists(sycl_rt_lib_path_full) |
| 1102 | if not exists: |
| 1103 | print('Invalid SYCL %s library path. %s cannot be found' % |
| 1104 | (_TF_OPENCL_VERSION, sycl_rt_lib_path_full)) |
| 1105 | return exists |
| 1106 | |
| 1107 | computecpp_toolkit_path = prompt_loop_or_load_from_env( |
| 1108 | environ_cp, |
| 1109 | var_name='COMPUTECPP_TOOLKIT_PATH', |
| 1110 | var_default=_DEFAULT_COMPUTECPP_TOOLKIT_PATH, |
| 1111 | ask_for_var=( |
| 1112 | 'Please specify the location where ComputeCpp for SYCL %s is ' |
| 1113 | 'installed.' % _TF_OPENCL_VERSION), |
| 1114 | check_success=toolkit_exists, |
| 1115 | error_msg='Invalid SYCL compiler path. %s cannot be found.', |
| 1116 | suppress_default_error=True) |
| 1117 | |
| 1118 | write_action_env_to_bazelrc('COMPUTECPP_TOOLKIT_PATH', |
| 1119 | computecpp_toolkit_path) |
| 1120 | |
| 1121 | |
| 1122 | def set_trisycl_include_dir(environ_cp): |
no test coverage detected