Skip to content

Commit 1a8f6b5

Browse files
Renaming ROCm with HIP
- Change from intel/llvm#4418
1 parent 41727c2 commit 1a8f6b5

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

SYCL/FilterSelector/select.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main() {
3939
bool HasLevelZeroDevices = false;
4040
bool HasOpenCLDevices = false;
4141
bool HasCUDADevices = false;
42-
bool HasROCmDevices = false;
42+
bool HasHIPDevices = false;
4343
bool HasOpenCLGPU = false;
4444
bool HasLevelZeroGPU = false;
4545

@@ -51,8 +51,8 @@ int main() {
5151
HasOpenCLDevices = true;
5252
} else if (Backend == backend::cuda) {
5353
HasCUDADevices = true;
54-
} else if (Backend == backend::rocm) {
55-
HasROCmDevices = true;
54+
} else if (Backend == backend::hip) {
55+
HasHIPDevices = true;
5656
}
5757
}
5858

@@ -67,7 +67,7 @@ int main() {
6767
std::cout << "HasLevelZeroDevices = " << HasLevelZeroDevices << std::endl;
6868
std::cout << "HasOpenCLDevices = " << HasOpenCLDevices << std::endl;
6969
std::cout << "HasCUDADevices = " << HasCUDADevices << std::endl;
70-
std::cout << "HasROCmDevices = " << HasROCmDevices << std::endl;
70+
std::cout << "HasHIPDevices = " << HasHIPDevices << std::endl;
7171
std::cout << "HasOpenCLGPU = " << HasOpenCLGPU << std::endl;
7272
std::cout << "HasLevelZeroGPU = " << HasLevelZeroGPU << std::endl;
7373

@@ -202,15 +202,15 @@ int main() {
202202
std::cout << "...PASS" << std::endl;
203203
}
204204

205-
if (HasROCmDevices) {
206-
std::cout << "Test 'rocm'";
207-
device d19(ext::oneapi::filter_selector("rocm"));
208-
assert(d19.get_platform().get_backend() == backend::rocm);
205+
if (HasHIPDevices) {
206+
std::cout << "Test 'hip'";
207+
device d19(ext::oneapi::filter_selector("hip"));
208+
assert(d19.get_platform().get_backend() == backend::hip);
209209
std::cout << "...PASS" << std::endl;
210210

211-
std::cout << "test 'rocm:gpu'";
212-
device d20(ext::oneapi::filter_selector("rocm:gpu"));
213-
assert(d20.is_gpu() && d19.get_platform().get_backend() == backend::rocm);
211+
std::cout << "test 'hip:gpu'";
212+
device d20(ext::oneapi::filter_selector("hip:gpu"));
213+
assert(d20.is_gpu() && d19.get_platform().get_backend() == backend::hip);
214214
std::cout << "...PASS" << std::endl;
215215
}
216216

SYCL/lit.cfg.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
# Mapping from SYCL_BE backend definition style to SYCL_DEVICE_FILTER used
158158
# for backward compatibility
159159
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]
161161
except:
162162
# do nothing a we expect that new format of plugin values are used
163163
pass
@@ -171,19 +171,19 @@
171171
if config.dump_ir_supported:
172172
config.available_features.add('dump_ir')
173173

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']:
175175
lit_config.error("Unknown SYCL BE specified '" +
176176
config.sycl_be +
177-
"' supported values are opencl, cuda, rocm, level_zero")
177+
"' supported values are opencl, cuda, hip, level_zero")
178178

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))
185185

186-
if config.sycl_be == "rocm" and config.rocm_platform == "AMD":
186+
if config.sycl_be == "hip" and config.hip_platform == "AMD":
187187
arch_flag = '-Xsycl-target-backend=amdgcn-amd-amdhsa-sycldevice --offload-arch=' + config.amd_arch
188188
else:
189189
arch_flag = ""
@@ -303,9 +303,9 @@
303303
config.substitutions.append( ('%ACC_RUN_PLACEHOLDER', acc_run_substitute) )
304304
config.substitutions.append( ('%ACC_CHECK_PLACEHOLDER', acc_check_substitute) )
305305

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'):
307307
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':
309309
config.substitutions.append( ('%sycl_triple', "amdgcn-amd-amdhsa-sycldevice" ) )
310310
else:
311311
config.substitutions.append( ('%sycl_triple', "spir64-unknown-unknown-sycldevice" ) )

0 commit comments

Comments
 (0)