You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before #7348, it was possible to specify any target architecture for NVIDIA/AMD backends using -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfxXXXX or -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda --offload-arch=sm_XX, or a combination of those.
Now, trying to specify an architecture not explicitly listed leads to a weird compile-time error:
$ clang++ -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx940 abc.cpp -c -o abc.cpp.oIn file included from <built-in>:849:<command line>:1:9: error: macro name must be an identifier#define -emit-llvm-bc 1 ^1 error generated.
Such commands worked fine before (as long as the respective backend recognized the architecture), but now only architectures explicitly listed in clang/lib/Driver/ToolChains/SYCL.cpp are allowed.
While having a list of "officially supported" architectures is very convenient, it is also useful to be able to compile for other architectures supported by the backend. See e.g., #8016 (consumer GPU) or comments in #8106 about RDNA3 and CDNA3, for which there already is some support in the backend. This would greatly facilitate testing on a new hardware.
Describe the solution you would like
As described in #8016, the code introduced in #7348 uses some hardcoded values to construct an interim Clang command line, which fails if the architecture is not explicitly allowed. Making the code more robust would allow using any architecture.
Describe alternatives you have considered
Not testing the new hardware
Opening an issue and waiting for a fix for every new piece of hardware
Don't throw ICE when an unknown device is specified explicitly via
`-Xsycl-target-backend --offload-arch=`. We don't enable macros or other
niceties from sycl_ext_oneapi_device_architecture, but at least the code
compiles.
Fixesintel#8112, intel#11203
Don't throw ICE when an unknown device is specified explicitly via
`-Xsycl-target-backend --offload-arch=`. We don't enable macros or other
niceties from sycl_ext_oneapi_device_architecture, but at least the code
compiles.
Fixes#8112, #11203, #12010
Is your feature request related to a problem? Please describe
This is a generalization #8016.
Before #7348, it was possible to specify any target architecture for NVIDIA/AMD backends using
-fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfxXXXX
or-fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda --offload-arch=sm_XX
, or a combination of those.Now, trying to specify an architecture not explicitly listed leads to a weird compile-time error:
Such commands worked fine before (as long as the respective backend recognized the architecture), but now only architectures explicitly listed in
clang/lib/Driver/ToolChains/SYCL.cpp
are allowed.While having a list of "officially supported" architectures is very convenient, it is also useful to be able to compile for other architectures supported by the backend. See e.g., #8016 (consumer GPU) or comments in #8106 about RDNA3 and CDNA3, for which there already is some support in the backend. This would greatly facilitate testing on a new hardware.
Describe the solution you would like
As described in #8016, the code introduced in #7348 uses some hardcoded values to construct an interim Clang command line, which fails if the architecture is not explicitly allowed. Making the code more robust would allow using any architecture.
Describe alternatives you have considered
The text was updated successfully, but these errors were encountered: