@@ -53,7 +53,6 @@ set(_dpctl_sycl_target_link_options)
53
53
54
54
set (_dpctl_sycl_targets )
55
55
set (_dpctl_cuda_arch )
56
- set (_dpctl_amd_targets )
57
56
if ("x${DPCTL_SYCL_TARGETS} " STREQUAL "x" )
58
57
if (NOT "x${DPCTL_TARGET_CUDA} " STREQUAL "x" )
59
58
if (DPCTL_TARGET_CUDA STREQUAL "ON" )
@@ -70,28 +69,33 @@ if ("x${DPCTL_SYCL_TARGETS}" STREQUAL "x")
70
69
endif ()
71
70
72
71
if (NOT "x${DPCTL_TARGET_HIP} " STREQUAL "x" )
73
- set (_dpctl_amd_targets ${DPCTL_TARGET_HIP} )
74
- if (_dpctl_sycl_targets )
75
- set (_dpctl_sycl_targets "amdgcn-amd-amdhsa,${_dpctl_sycl_targets} " )
72
+ if (DPCTL_TARGET_HIP MATCHES "^gfx" )
73
+ if (_dpctl_sycl_targets )
74
+ set (_dpctl_sycl_targets "amd_gpu_${DPCTL_TARGET_HIP} ,${_dpctl_sycl_targets} " )
75
+ else ()
76
+ set (_dpctl_sycl_targets "amd_gpu_${DPCTL_TARGET_HIP} ,spir64-unknown-unknown" )
77
+ endif ()
76
78
else ()
77
- set (_dpctl_sycl_targets "amdgcn-amd-amdhsa,spir64-unknown-unknown" )
79
+ message (FATAL_ERROR
80
+ "Invalid value for DPCTL_TARGET_HIP: \" ${DPCTL_TARGET_HIP} \" . "
81
+ "Expected something starting with 'gfx', e.g. 'gfx1030'."
82
+ )
78
83
endif ()
79
84
endif ()
80
85
else ()
81
- set (_dpctl_sycl_targets ${DPCTL_SYCL_TARGETS} )
82
- if (NOT "x${DPCTL_TARGET_HIP} " STREQUAL "x" )
83
- set (_dpctl_amd_targets ${DPCTL_TARGET_HIP} )
86
+ if ("${DPCTL_SYCL_TARGETS} " MATCHES "amdgcn-amd-amdhsa" )
87
+ message (FATAL_ERROR
88
+ "Legacy target 'amdgcn-amd-amdhsa' is not supported. "
89
+ "Use alias form 'amd_gpu_<arch>' instead."
90
+ )
84
91
endif ()
92
+ set (_dpctl_sycl_targets ${DPCTL_SYCL_TARGETS} )
85
93
endif ()
86
94
87
95
if (_dpctl_sycl_targets )
88
96
message (STATUS "Compiling for -fsycl-targets=${_dpctl_sycl_targets} " )
89
97
list (APPEND _dpctl_sycl_target_compile_options -fsycl-targets=${_dpctl_sycl_targets} )
90
98
list (APPEND _dpctl_sycl_target_link_options -fsycl-targets=${_dpctl_sycl_targets} )
91
- if (_dpctl_amd_targets )
92
- list (APPEND _dpctl_sycl_target_compile_options -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=${_dpctl_amd_targets} )
93
- list (APPEND _dpctl_sycl_target_link_options -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=${_dpctl_amd_targets} )
94
- endif ()
95
99
endif ()
96
100
97
101
add_subdirectory (libsyclinterface )
0 commit comments