|
176 | 176 | if lit_config.params.get("igc-dev", False): |
177 | 177 | config.available_features.add("igc-dev") |
178 | 178 |
|
| 179 | +# Map between device family and architecture types. |
| 180 | +device_family_arch_map = { |
| 181 | + # <Family name> : Set of architectures types (and aliases) |
| 182 | + # DG2 |
| 183 | + "gpu-intel-dg2": { |
| 184 | + "intel_gpu_acm_g12", |
| 185 | + "intel_gpu_dg2_g12", |
| 186 | + "intel_gpu_acm_g11", |
| 187 | + "intel_gpu_dg2_g11", |
| 188 | + "intel_gpu_acm_g10", |
| 189 | + "intel_gpu_dg2_g10", |
| 190 | + }, |
| 191 | + # Gen12 |
| 192 | + "gpu-intel-gen12": {"intel_gpu_tgllp", "intel_gpu_tgl"}, |
| 193 | + # Gen11 |
| 194 | + "gpu-intel-gen11": {"intel_gpu_icllp", "intel_gpu_icl"}, |
| 195 | +} |
| 196 | + |
| 197 | + |
| 198 | +def get_device_family_from_arch(arch): |
| 199 | + for device_family, arch_set in device_family_arch_map.items(): |
| 200 | + if arch in arch_set: |
| 201 | + return device_family |
| 202 | + return None |
| 203 | + |
179 | 204 | def check_igc_tag_and_add_feature(): |
180 | 205 | if os.path.isfile(config.igc_tag_file): |
181 | 206 | with open(config.igc_tag_file, "r") as tag_file: |
@@ -773,10 +798,27 @@ def open_check_file(file_name): |
773 | 798 | aspect_features = set("aspect-" + a for a in aspects) |
774 | 799 | sg_size_features = set("sg-" + s for s in sg_sizes) |
775 | 800 | architecture_feature = set("arch-" + s for s in architectures) |
| 801 | + # Add device family features like intel-gpu-gen12, intel-gpu-dg2 based on |
| 802 | + # the architecture reported by sycl-ls. |
| 803 | + device_family = set( |
| 804 | + get_device_family_from_arch(arch) |
| 805 | + for arch in architectures |
| 806 | + if get_device_family_from_arch(arch) is not None |
| 807 | + ) |
| 808 | + |
| 809 | + # Print the detected GPU family name. |
| 810 | + if len(device_family) > 0: |
| 811 | + lit_config.note( |
| 812 | + "Detected GPU family for {}: {}".format( |
| 813 | + sycl_device, ", ".join(device_family) |
| 814 | + ) |
| 815 | + ) |
| 816 | + |
776 | 817 | features = set() |
777 | 818 | features.update(aspect_features) |
778 | 819 | features.update(sg_size_features) |
779 | 820 | features.update(architecture_feature) |
| 821 | + features.update(device_family) |
780 | 822 |
|
781 | 823 | be, dev = sycl_device.split(":") |
782 | 824 | features.add(dev.replace("fpga", "accelerator")) |
|
0 commit comments