|
157 | 157 | # Mapping from SYCL_BE backend definition style to SYCL_DEVICE_FILTER used
|
158 | 158 | # for backward compatibility
|
159 | 159 | try:
|
160 |
| - config.sycl_be = { 'PI_OPENCL': 'opencl', 'PI_CUDA': 'cuda', 'PI_ROCM': 'rocm', 'PI_LEVEL_ZERO': 'level_zero'}[config.sycl_be] |
| 160 | + config.sycl_be = { 'PI_OPENCL': 'opencl', 'PI_CUDA': 'cuda', 'PI_HIP': 'hip', 'PI_LEVEL_ZERO': 'level_zero'}[config.sycl_be] |
161 | 161 | except:
|
162 | 162 | # do nothing a we expect that new format of plugin values are used
|
163 | 163 | pass
|
|
171 | 171 | if config.dump_ir_supported:
|
172 | 172 | config.available_features.add('dump_ir')
|
173 | 173 |
|
174 |
| -if config.sycl_be not in ['host', 'opencl', 'cuda', 'rocm', 'level_zero']: |
| 174 | +if config.sycl_be not in ['host', 'opencl', 'cuda', 'hip', 'level_zero']: |
175 | 175 | lit_config.error("Unknown SYCL BE specified '" +
|
176 | 176 | config.sycl_be +
|
177 |
| - "' supported values are opencl, cuda, rocm, level_zero") |
| 177 | + "' supported values are opencl, cuda, hip, level_zero") |
178 | 178 |
|
179 |
| -# If ROCM_PLATFORM flag is not set, default to AMD, and check if ROCM platform is supported |
180 |
| -supported_rocm_platforms=["AMD", "NVIDIA"] |
181 |
| -if config.rocm_platform == "": |
182 |
| - config.rocm_platform = "AMD" |
183 |
| -if config.rocm_platform not in supported_rocm_platforms: |
184 |
| - lit_config.error("Unknown ROCm platform '" + config.rocm_platform + "' supported platforms are " + ', '.join(supported_rocm_platforms)) |
| 179 | +# If HIP_PLATFORM flag is not set, default to AMD, and check if HIP platform is supported |
| 180 | +supported_hip_platforms=["AMD", "NVIDIA"] |
| 181 | +if config.hip_platform == "": |
| 182 | + config.hip_platform = "AMD" |
| 183 | +if config.hip_platform not in supported_hip_platforms: |
| 184 | + lit_config.error("Unknown HIP platform '" + config.hip_platform + "' supported platforms are " + ', '.join(supported_hip_platforms)) |
185 | 185 |
|
186 |
| -if config.sycl_be == "rocm" and config.rocm_platform == "AMD": |
| 186 | +if config.sycl_be == "hip" and config.hip_platform == "AMD": |
187 | 187 | arch_flag = '-Xsycl-target-backend=amdgcn-amd-amdhsa-sycldevice --offload-arch=' + config.amd_arch
|
188 | 188 | else:
|
189 | 189 | arch_flag = ""
|
|
303 | 303 | config.substitutions.append( ('%ACC_RUN_PLACEHOLDER', acc_run_substitute) )
|
304 | 304 | config.substitutions.append( ('%ACC_CHECK_PLACEHOLDER', acc_check_substitute) )
|
305 | 305 |
|
306 |
| -if config.sycl_be == 'cuda' or (config.sycl_be == 'rocm' and config.rocm_platform == 'NVIDIA'): |
| 306 | +if config.sycl_be == 'cuda' or (config.sycl_be == 'hip' and config.hip_platform == 'NVIDIA'): |
307 | 307 | config.substitutions.append( ('%sycl_triple', "nvptx64-nvidia-cuda-sycldevice" ) )
|
308 |
| -elif config.sycl_be == 'rocm' and config.rocm_platform == 'AMD': |
| 308 | +elif config.sycl_be == 'hip' and config.hip_platform == 'AMD': |
309 | 309 | config.substitutions.append( ('%sycl_triple', "amdgcn-amd-amdhsa-sycldevice" ) )
|
310 | 310 | else:
|
311 | 311 | config.substitutions.append( ('%sycl_triple', "spir64-unknown-unknown-sycldevice" ) )
|
|
0 commit comments