[nvptx] Add missing t-omp-device isas
authorTom de Vries <tdevries@suse.de>
Wed, 23 Feb 2022 14:58:59 +0000 (15:58 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 24 Feb 2022 08:19:01 +0000 (09:19 +0100)
In t-omp-device we list isas that can be used in omp declare variant like so:
...
  #pragma omp declare variant (f30) match (device={isa("sm_30")})
...
and in nvptx_omp_device_kind_arch_isa we handle them.

Update both to reflect the current list of isas.

Tested on x86_64-linux with nvptx accelerator.

gcc/ChangeLog:

2022-02-23  Tom de Vries  <tdevries@suse.de>

* config/nvptx/nvptx.cc (nvptx_omp_device_kind_arch_isa): Handle
sm_70, sm_75 and sm_80.
* config/nvptx/t-omp-device: Add sm_53, sm_70, sm_75 and sm_80.

Co-Authored-By: Tobias Burnus <tobias@codesourcery.com>
gcc/config/nvptx/nvptx.cc
gcc/config/nvptx/t-omp-device

index 6f6d592..b9451c2 100644 (file)
@@ -6181,7 +6181,13 @@ nvptx_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait,
       if (strcmp (name, "sm_35") == 0)
        return TARGET_SM35 && !TARGET_SM53;
       if (strcmp (name, "sm_53") == 0)
-       return TARGET_SM53;
+       return TARGET_SM53 && !TARGET_SM70;
+      if (strcmp (name, "sm_70") == 0)
+       return TARGET_SM70 && !TARGET_SM75;
+      if (strcmp (name, "sm_75") == 0)
+       return TARGET_SM75 && !TARGET_SM80;
+      if (strcmp (name, "sm_80") == 0)
+       return TARGET_SM80;
       return 0;
     default:
       gcc_unreachable ();
index 8765d9f..4228218 100644 (file)
@@ -1,4 +1,4 @@
 omp-device-properties-nvptx: $(srcdir)/config/nvptx/nvptx.cc
        echo kind: gpu > $@
        echo arch: nvptx >> $@
-       echo isa: sm_30 sm_35 >> $@
+       echo isa: sm_30 sm_35 sm_53 sm_70 sm_75 sm_80 >> $@