PTX_VERSION_unset,
PTX_VERSION_default = PTX_VERSION_unset,
PTX_VERSION_3_1,
+ PTX_VERSION_4_1,
PTX_VERSION_4_2,
PTX_VERSION_6_0,
PTX_VERSION_6_3,
{
case PTX_VERSION_3_1:
return "3.1";
+ case PTX_VERSION_4_1:
+ return "4.1";
case PTX_VERSION_4_2:
return "4.2";
case PTX_VERSION_6_0:
{
case PTX_VERSION_3_1:
return major_p ? 3 : 1;
+ case PTX_VERSION_4_1:
+ return major_p ? 4 : 1;
case PTX_VERSION_4_2:
return major_p ? 4 : 2;
case PTX_VERSION_6_0:
/* There are no 'TARGET_PTX_3_1' and smaller conditionals: our baseline is
PTX ISA Version 3.1. */
+#define TARGET_PTX_4_1 (ptx_version_option >= PTX_VERSION_4_1)
#define TARGET_PTX_4_2 (ptx_version_option >= PTX_VERSION_4_2)
#define TARGET_PTX_6_0 (ptx_version_option >= PTX_VERSION_6_0)
#define TARGET_PTX_6_3 (ptx_version_option >= PTX_VERSION_6_3)
EnumValue
Enum(ptx_version) String(3.1) Value(PTX_VERSION_3_1)
+EnumValue
+Enum(ptx_version) String(4.1) Value(PTX_VERSION_4_1)
+
EnumValue
Enum(ptx_version) String(4.2) Value(PTX_VERSION_4_2)
Generate code for the specified PTX ISA version.
Valid version strings are
@samp{3.1},
-@samp{4.2},
+@samp{4.1}, @samp{4.2},
@samp{6.0}, @samp{6.3},
and @samp{7.0}.
The default PTX ISA version is 6.0, unless a higher
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options {-march=sm_30 -mptx=4.1} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^ \.version 4\.1$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 4
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 1
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 300
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;