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